lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Wettin <karl.wet...@gmail.com>
Subject Re: SpanFirstQuery is not taking wildcard characters (like *) as a logical operator for the preffix
Date Fri, 28 Nov 2008 21:09:22 GMT
There has been several discussions on this list on how to create an  
"auto complete" feature. What solution fits best for you depends on  
your needs and the behavior of your users, i.e. what sort of documents  
it is your index contains and what part of the documents your users  
are searching for.

I think think the most common solution recommended is to use ngrams.  
This is however probably only interesting if you want to "auto  
complete" on small texts such as titles, subject lines, et c.

Personally I prefere training a trie with common user queries (that  
leads to hits users clicks on). This does however require that the  
system have enough user load. See LUCENE-625 for such a trie.


       karl

28 nov 2008 kl. 10.55 skrev naveen.a:

>
> Hi,
>
> Thanks for your reply,
> The actual problem is when the user is entering data in a textfield,  
> the
> suggession list should come below the textfield, so when the  
> character 'l'
> is entered, the suggessions should come as starts with 'l' and if he  
> entered
> the full word say 'library ' and then he gives a space and he  
> continues
> typing for the next word say 'library inf' (actual word is "library
> information"), so here the word "library information" is indexed
> (untokenized or tokenized), now i have to search by the exact  
> sequence, if i
> apply query as "library inf*", the document should be returned, so i  
> am
> looking for lucene advanced search techniques and i thought it can be
> possible with SpanFirstQuery because it can search by sequence, but  
> it cant
> search as a startswith (for "library inf*")
>
>
>
>
> Karl Wettin wrote:
>>
>> SpanTermQuery is a TermQuery and not a WildcardQuery. You could use a
>> SpanRegexQuery. You could also make your own SpanWildcardQuery based
>> on either WildcardQuery or SpanRegexQuery.
>>
>>
>> You should probably tell us a bit about the problem you try to solve
>> rather than asking about the solution you have thought of.
>>
>> 27 nov 2008 kl. 14.47 skrev naveen.a:
>>
>>>
>>> Below is a document in lucene
>>> ----------------------------------------------
>>> ID : 1
>>> 110_a : library information
>>> ----------------------------------------------
>>> Case 1:
>>> Term term1 = new Term("110_a", "library");
>>> SpanFirstQuery spanFirstQuery = new SpanFirstQuery(new
>>> SpanTermQuery(term1),
>>> 1);
>>>
>>> Case 2:
>>> Term term1 = new Term("110_a", "l*");
>>> SpanFirstQuery spanFirstQuery = new SpanFirstQuery(new
>>> SpanTermQuery(term1),
>>> 1);
>>>
>>> if i apply first query, the documnet is found,
>>> but, it is not found for the second query
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/SpanFirstQuery-is-not-taking-wildcard-characters-%28like-*%29-as-a-logical-operator-for-the-preffix-tp20719556p20719556.html
>>> Sent from the Lucene - Java Users mailing list archive at  
>>> Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/SpanFirstQuery-is-not-taking-wildcard-characters-%28like-*%29-as-a-logical-operator-for-the-preffix-tp20719556p20731617.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message