Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LuceneService.java dosn't work with more than one fulltext index field #44

Closed
willie68 opened this issue Jan 25, 2018 · 4 comments
Closed
Assignees
Labels
Milestone

Comments

@willie68
Copy link

willie68 commented Jan 25, 2018

LuceneService.zip
The text indexing service for lucene do not work with more than one index field. Because for every index field the update method is called. But the update method doesn't update but replaces the already indexed document with the new field. The last field is winning.
Btw. the used lucene version is very old.
Here i add a more up to date version working with lucene 7.2.1.

LuceneService.zip

@anidotnet
Copy link
Contributor

anidotnet commented Jan 25, 2018

The lucene service is an example how one can add external text indexing engine. I did not gave much time to it. Need to look at that what yo are saying. Does your code handle this too?

EDIT: I see now you have handled everything. Nice work. Would it be possible for you to create a pull request?

@anidotnet anidotnet self-assigned this Jan 25, 2018
@willie68
Copy link
Author

Yes, both. It's using lucene 7.2.1 and handles the updating of the index fields.
For every update index call i try to fetch the already indexed document from lucene and than add the new field to it. For that, i have to store (not only analyse and index) the fields into lucene. Creation of the document field will be with Field contentField = new TextField(field, text, **Field.Store.YES**);
The main issue is with indexWriter.updateDocument(new Term(CONTENT_ID, jsonId), document);
because updateDocument will by first delete all documents containing the term and then adding the new one. (See lucene javadoc on updateDocument.)
BTW.: i like nitrite very much...

@anidotnet
Copy link
Contributor

Yes now I see it. I have updated my previous comment. Would it be possible for you to create a pull request?

@willie68
Copy link
Author

pull request created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants