I've recently deployed a fairly large site running Umbraco 7, and the site is using Examine for search functionality. Our search form auto suggest pages based on what the user enters.
It doesn't work optimally however, the user have to enter pretty many characters before Examine returns any results.
We want that if the user enters the letter "A" Examine returns all pages starting with A (big or small shouldn't matter). They should be sorted alphabetically. So when the user enters more characters more pages are shown. Right now the user have to spell out the entire word before Examine shows any results.
You need to look at your code that is doing the search I take it autosuggest is being called using jquery and that is making request to webapi?
If you want really good autosuggest then I would take a look at the elastic search definitive guide book (http://www.amazon.co.uk/Elasticsearch-Definitive-Guide-Clinton-Gormley/dp/1449358543/ref=sr_1_1?s=books&ie=UTF8&qid=1432131102&sr=1-1&keywords=elasticsearch+the+definitive+guide) there is chapter in there about the concepts of auto suggest. Although its related to elastic search the principles (ngrams and edgegrams) relate to lucene or in this case lucene.net examine is just a wrapper around lucene.net just as elastic is wrapper around lucene.
can you not just add quotes around your term, like so?
var query = string.format("Name:'{0}*'",term);
Not tried this, so just a guess - also, your analysers will play an important part in how your queries return results and how whitespace is handled (aside: it may work to add in a custom field with the name stripped of spaces and also strip the spaces from your search term when you pass it in - look at gatheringnodedata event handler for more info)
Also, donwload luke and open your index and you can play around with lucene queries to your hearts content - it's a good way to test raw queries and explore lucene: http://www.getopt.org/luke/
just remember to set the correct analyser to match the one in your examine config so you get the right results.
Examine improve search suggestions
I've recently deployed a fairly large site running Umbraco 7, and the site is using Examine for search functionality. Our search form auto suggest pages based on what the user enters.
It doesn't work optimally however, the user have to enter pretty many characters before Examine returns any results.
We want that if the user enters the letter "A" Examine returns all pages starting with A (big or small shouldn't matter). They should be sorted alphabetically. So when the user enters more characters more pages are shown. Right now the user have to spell out the entire word before Examine shows any results.
Whenever i need to do anything complicated, i usually dip in RawQuery mode and use this guide to help: http://www.lucenetutorial.com/lucene-query-syntax.html
For some reason i find RawQuery easier to pick up and understand, but as ever, i'm sure there are a million and 1 ways to do it!
enjoy
Ian
Thank you TikTakToe for your quick reply, works great :)
However as soon as there are spaces in the search term, the results is weird and doesn't have any relevance anymore.
Anton,
You need to look at your code that is doing the search I take it autosuggest is being called using jquery and that is making request to webapi?
If you want really good autosuggest then I would take a look at the elastic search definitive guide book (http://www.amazon.co.uk/Elasticsearch-Definitive-Guide-Clinton-Gormley/dp/1449358543/ref=sr_1_1?s=books&ie=UTF8&qid=1432131102&sr=1-1&keywords=elasticsearch+the+definitive+guide) there is chapter in there about the concepts of auto suggest. Although its related to elastic search the principles (ngrams and edgegrams) relate to lucene or in this case lucene.net examine is just a wrapper around lucene.net just as elastic is wrapper around lucene.
Regards
Ismail
hi anton
can you not just add quotes around your term, like so?
var query = string.format("Name:'{0}*'",term);
Not tried this, so just a guess - also, your analysers will play an important part in how your queries return results and how whitespace is handled (aside: it may work to add in a custom field with the name stripped of spaces and also strip the spaces from your search term when you pass it in - look at gatheringnodedata event handler for more info)
Also, donwload luke and open your index and you can play around with lucene queries to your hearts content - it's a good way to test raw queries and explore lucene: http://www.getopt.org/luke/
just remember to set the correct analyser to match the one in your examine config so you get the right results.
something like
then in your search:
is working on a reply...