[Issue #31] (Team 4) Enabling positional indexing in Lucene for TEXT type#103
Conversation
|
@sandeepreddy602 @chenlica Please review. |
| fieldName, (String) fieldValue, Store.YES); | ||
| break; | ||
|
|
||
| org.apache.lucene.document.FieldType luceneFieldType = new org.apache.lucene.document.FieldType(); |
There was a problem hiding this comment.
Add comments to the codebase: "By default we enable positional indexing in Lucene so that we can return information about character offsets and token offsets.""
|
I left a few minor comments. It will be good if @sandeepreddy602 can also review it quickly. Then you can do the merge. |
|
@chenlica @sandeepreddy602 @prakul Please Review. |
| this.end = end; | ||
| this.key = key; | ||
| this.value = value; | ||
| this.tokenOffset = -1; |
There was a problem hiding this comment.
Give "-1" to a meaning constant such as "INVALID_TOKEN_OFFSET"?
|
Added @zuozhi and @rajesh9625 in case they are interested to review as well. |
| if (other.list != null) | ||
| return false; | ||
| } else if (!list.equals(other.list)) | ||
| } else if (!list.containsAll(other.list)) |
There was a problem hiding this comment.
Why don't we use equals()?
There was a problem hiding this comment.
Because even though the list has same number of elements, with same values, equals return false, where as containsAll returns True
other.list.containsAll(list) Returns True;
list.containsAll(others.list) Returns True;
other.list.equals(list) Returns False
There was a problem hiding this comment.
Is it because equals() cares about order, why we don't? If so, then the name "list" is not accurate. Should we rename it to "SetField"?
There was a problem hiding this comment.
Why is the "list" name not accurate?
There was a problem hiding this comment.
I am still not following. Why "other.list.equals(list) Returns False"?
Previously a TEXT field doesn't enable positional indexing. In this PR we enable positional indexing in Lucene so that we can return information about character offsets and token offsets.