0
votes

Basically i am C# developer but in one of my project i need to implement the Lucene search.

In short it is a Chat application and i need to find the specific word used by any of the users

Now i am able to successfully integrate Lucene.Net in my project. Now my question is what the best ways to store text or create index.

Is it better to have

  1. one text field (lucene index) with 5000 words
  2. 500 fields (lucene index) with 10 words each in it

Sorry for if its a wrong terminology but i really dont know how to describe it in proper Lucene term.

Appreciate your time and feedback. Many thanks

1
If your goal is to search among text and have a ranking, the use of the same field is suggested to have the "words" (actually called terms) in one field to use the norm.pokeRex110

1 Answers

0
votes

I would add 'document' that contains these fields: Message(indexed, stored, analyzed), UserName(indexed, stored). The ’stored' attribute can be omitted if you don't need access to original message text.

To find which users used specific word in their messages use query (TermQuery or other) for Message field.