lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Order of StoredFieldVisitor.*Field calls?
Date Thu, 28 Jul 2016 13:27:30 GMT
I suspect the visitor will be called in order that the stored fields were
originally added to the Document at indexing time, but I'm not sure whether
this is guaranteed behavior across Lucene releases.

Mike McCandless

http://blog.mikemccandless.com

On Thu, Jul 28, 2016 at 6:35 AM, Andreas Sewe <andreas.sewe@codetrails.com>
wrote:

> Hi,
>
> I am currently looking at the StoredFieldVisitor visitor to make the
> conversion from Documents into my own search results more efficient. My
> current code looks like this:
>
>   Document doc = searcher.doc(id);
>   ISearchResult result = convert(doc);
>
> My convert(Document) method creates, depending on a dedicated "type"
> field of the Document, one of several different subtypes of
> ISearchResult and then copies over the Document's field data into the
> newly created object.
>
> Obviously, going through an intermediate Document object is wasteful.
> Hence, I want to use a StoredFieldVisitor that directly produces
> ISearchResults. In order to create the correct subtype of ISearchResult,
> however, I would need so assurance that my "type" field is visited
> first. Is this possible?
>
> Best wishes,
>
> Andreas
>
> --
> Codetrails GmbH
> The knowledge transfer company
>
> Robert-Bosch-Str. 7, 64293 Darmstadt
> Phone: +49-6151-276-7092
> Mobile: +49-170-811-3791
> http://www.codetrails.com/
>
> Managing Director: Dr. Marcel Bruch
> Handelsregister: Darmstadt HRB 91940
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message