lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nuno Oliveira <nolive...@itclinical.com>
Subject Re: LongPoint.newRangeQuery results differ from LegacyNumericRangeQuery.newLongRange
Date Tue, 25 Jul 2017 14:33:55 GMT
Thank you for your answer Chris.

What I did was to get all the Documents from the old indexes, and loop
the existingDocuments, then I replaced the "date" field by the same
values but created with LongPoints.
Something like this:
	
for (Document existingDocument : existingDocuments) {
Document doc = createDocument();

doc.add(createStringField("recordId", existingDocument.get("recordId"),
Field.Store.YES));

//Here I create a new LongPoint based on the "date" of the 
//old documents represented by LongField 
doc.add(new
LongPoint("date",Long.valueOf(existingDocument.get("date"))));

indexWriter.updateDocument(new
Term("recordId",existingDocument.get("recordId")), doc);
}

This way my queries are returning the number of hits I expected.
Do you think this is wrong in any way? I don't know if this can be
considered reindex, since I'm not using the original documents to index
but old indexes and if it can cause any problems.

Thanks,
Nuno Oliveira 



On Seg, 2017-07-24 at 13:48 -0700, Chris Hostetter wrote:
> The Points data structures are completley different and distinct 
> from the Term Index structures used by LegacyNumeric fields -- just having 
> hte backwards codex (or using merges to convert indexes to the new index 
> format) isn't enough -- you have to reindex.
> 
> 
> 
> -Hoss
> http://www.lucidworks.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message