I'm trying to get my head around creating a autocomplete/suggest dropdown from a searchfield (just a simple input, really) using Examine. I have created a handler which is called when a user enters more than three characters in the input field.
When I write something in the input and a result is found, it shows the suggest dropdown as it should. However, when I enter multiple words, it disappears (thus no results)
In example: I have a page with the header Hello World
I enter "hello" in the input field and the page "Hello World" pops up in the suggest dropdown. When I enter the whitespace, it disappears - also when I start typing "world".
Is there any way to make examine/lucene search for a phrase rather than a single word? :-)
In examine before doing the query check for white space if its there split on it then do or query with each term. uQuery is fine for now but once you start getting more nodes you will not get same performance as examine which is lightening quick!!
Examine autocomplete with multiple words
Hi all,
I'm trying to get my head around creating a autocomplete/suggest dropdown from a searchfield (just a simple input, really) using Examine. I have created a handler which is called when a user enters more than three characters in the input field.
The examine code in my handler is as follows:
When I write something in the input and a result is found, it shows the suggest dropdown as it should. However, when I enter multiple words, it disappears (thus no results)
In example: I have a page with the header Hello World
I enter "hello" in the input field and the page "Hello World" pops up in the suggest dropdown. When I enter the whitespace, it disappears - also when I start typing "world".
Is there any way to make examine/lucene search for a phrase rather than a single word? :-)
Thanks in advance!
- Bo
I went and made the search with XPath instead of Examine. The performance is almost the same and it works with whitespace aswell.
Code:
Bo,
In examine before doing the query check for white space if its there split on it then do or query with each term. uQuery is fine for now but once you start getting more nodes you will not get same performance as examine which is lightening quick!!
Regards
Ismail
is working on a reply...