In Lucene I need to add some information about the post for search. For make a better search I thing to add the tags name or some other information to make a bettter search. What option I choose whenever I have two possible option for solve this problem.
Append the tags into the content or excerpt of the post I have.
Or make a new index to solve the same puzzle.
Well I need to know what is different if I append them in existing index or make a new index in lucene to store an another kind of information.
You should add your tags to a separate tokenised
tagfield.A typical query would look something like this:
The first two terms (
hondaandcivic) are entered by the user, while the second two terms (redandhatchback) would be selected from a list of tags.If you want to support tags that contain spaces, you will have to roll your own tokeniser by subclassing
CharTokenizer: Lucene.Net support phrases?: What is best approach to tokenize comma-delimited data (atomically) in fields during indexing?You can create a separate index for your
tagfield, but you will have to use aMultiSearcherto perform a combined search of the separated indexes.