lucene.net - Query types within Lucene -


Lucene NOOB warning!

I myself considered to be the person of the least wisdom, but I

in my special example, I have to find a single string field in my document which is only the moderate length (approx. 50-character average).

I want users to be able to type the beginning of the items they are searching for.

Example field: "Generic brand strength"

Searches should match: "Normal brand strength" "Brand generic strength" ... "Gene bran str" "Bran generic str ... ... etc. ..

It is possible that I have to store my information (each word of the example) in different areas if it helps

I present In the world of fuzzy wildcards and multi-term phrases I have been lost.

A can explain this whole scenario? (And yes, I have seen it for a large scale online, but a decent resource can not be found).

BTW I am using Lusen 2.9 But I do not think that really matters.

Each word within a different area No need to store.

Example field:

If you use whitepaper basket "Generic brand strength" "brand generic strength"

The above questions will return both results, "Generic brand strength",

The score for the less obvious reasons for the latter, however, "Gene Brain Str" "Bran Generic Str ... ... is difficult, because it appears that the words are not standard" stemming ", in this case you have a stammer analyzer You can use.

The simplest approach will be:

  1. Split your question phrase from white space, so that you have a string []
  2. A Booleanquery Use and add a word to create a query Finally the wildcard.

Something like this:

  string [] words = query.split (""); Boolean extraction BCE = new booleanactine (); Foreach (words in the word string) bq.Add (new query ("field name", word + "*", ...);  

Better query types such as Spanquay, Dimmax etc., but Since you have mentioned noob warning, it seems that the above is simplicity (though not the most elegant) approach.

HTH


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -