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: How to load all document fields, together with facet fields?
Date Fri, 01 Sep 2017 13:02:15 GMT
You should separately add those fields to your document, using StoredField,
if you want to retrieve their values at search time.

Mike McCandless

http://blog.mikemccandless.com

On Thu, Aug 31, 2017 at 1:29 PM, Vjeran Marcinko <vmarcinko@gmail.com>
wrote:

> I zeroed in the problem with my updating documents having facet
> fields... What I need is a way to load document with all fields that
> existing when I was saving the document, meaning, together with facet
> fields.
>
> Anyway, here's the example.
>
> When I add my document to index, my document is having 3 fields:
> "name", "category" and 3rd field is SortedSetDocValueFacetField named
> also "category". This is the list of fields printed:
>
> name = firstDoc (stored,indexed,omitNorms,indexOptions=DOCS)
> category = cars (stored,indexed,tokenized)
> dummy = null (indexed,tokenized)
>
> And before adding to index I build the final document via
> facetConfig.build(doc)  which produces following fields:
>
> facet_category = null (docValuesType=SORTED_SET)
> facet_category = category cars (indexed,omitNorms,indexOptions=DOCS)
> facet_category = category (indexed,omitNorms,indexOptions=DOCS)
> name = firstDoc (stored,indexed,omitNorms,indexOptions=DOCS)
> category = cars (stored,indexed,tokenized)
>
> But, when I load the document plainly using IndexSearcher, I get following:
>
> name = firstDoc (stored,indexed,tokenized,omitNorms,indexOptions=DOCS)
> category = cars (stored,indexed,tokenized)
>
> Which is not good if I want to update the document, because there are
> no facet fields anymore here, so when I update it, these fields get
> lost, so my faceted searching afterwards don't work :(
>
> Any suggestion?
>
> -Vjeran
>
> ---------------------------------------------------------------------
> 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