0
votes

I have a scenario in my project where we are using Lucene to search. I'm indexing many fields. Now i store a typeId as one of those fields. The user needs to search on Type Text. But the issue is that the Type text can be later modified. But reindexing is not an option. Need some better solution,so please can Lucene users guide me with some solutions.

The solution I can think of is to check if the search text is TypeText, then manipulate the search text to TypeId:GuidValue and then fire the query.

Please can Lucene users give some better ideas. Im quite new to Lucene, read about the various Query types Lucene offers, but i dunt understand how to best use them.

Thanks in advance.

1
What's "type text"? Could you give some examples of your data? - sisve
Its free text , for example "Patient" ,"Doctor", "Regular Nurse shift", "Partime Nurse shift". - Deefa

1 Answers

0
votes

If I understand correctly, you have some Type objects that have a Text property that can change, and an Id property that is a GUID that doesnt change.

If you dont want to changed the Type.Text value in the index, you will need to resolve the Type.Id it corresponds to in your application, and then query the appropriate Type.Id in lucene. (like your solution suggests)

But not wanting to update the indexed text value kind of defeats the purpose of using a Text indexing engine.