[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-user
Subject:    Re: LongPoint.newRangeQuery results differ from LegacyNumericRangeQuery.newLongRange
From:       Nuno Oliveira <noliveira () itclinical ! com>
Date:       2017-07-25 14:33:55
Message-ID: 1500993235.4521.16.camel () itdc006
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic