I'm trying to get my head around searching with both a whole, matching sentence (from an AutoComplete textfield) and just a single word.
Right now, my search only works if I enter "about" in the search field and the matching result is "About Us". Now, if I choose "About Us" from the autocomplete dropdown and use that as my searchterm, it returns no results at all.
I'm aware that it's because I'm using the MultipleCharacterWildcard() method for my search query, but is there a way to make it search both with and without it?
Examine search for exact sentence and single word
Hi all,
I'm trying to get my head around searching with both a whole, matching sentence (from an AutoComplete textfield) and just a single word.
Right now, my search only works if I enter "about" in the search field and the matching result is "About Us". Now, if I choose "About Us" from the autocomplete dropdown and use that as my searchterm, it returns no results at all.
I'm aware that it's because I'm using the MultipleCharacterWildcard() method for my search query, but is there a way to make it search both with and without it?
My query looks like this atm:
I've tried with both .Or() and .And(), but without any luck :-/
Thanks in advance!
All the best,
Bo
Hi
Have you looked at this explanation: http://umbraco.com/follow-us/blog-archive/2011/9/16/examining-examine.aspx
Specifically the section Power Searching with Raw Lucene Queries, which covers searching for whole sentences.
is working on a reply...