[ 
https://issues.apache.org/jira/browse/LUCENE-9450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17174343#comment-17174343
 ] 

Michael McCandless commented on LUCENE-9450:
--------------------------------------------

+1, thanks [~gworah]!  It is really silly that the taxonomy index uses stored 
fields today and must do a number of stored field lookups for each query to 
resolve taxonomy ordinals back to human presentable facet labels.

At search time, after pulling the {{BinaryDocValues}}, you need to 
{{.advanceExact}} to that docid, confirm (maybe, {{assert}}?) that method 
returns {{true}}, then pull the {{.binaryValue()}}.

Did you see an exception in tests when you tried your patch?  The default 
{{Codec}} should throw an exception if you try to pull a {{.binaryValue()}} 
without first calling {{.advancExact()}} I hope.

Also, at indexing time, it looks like you are no longer indexing the 
{{StringField}}, but I think you must keep indexing it, but change the 
{{Field.Store.YES}} to {{Field.Store.NO}}.  This field is also stored in the 
inverted index and is what allows us to do the label -> ordinal lookup, I think.

Maybe post some of the failing tests if those two above fixes still don't work? 
 Thanks for tackling this!

> Taxonomy index should use DocValues not StoredFields
> ----------------------------------------------------
>
>                 Key: LUCENE-9450
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9450
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/facet
>    Affects Versions: 8.5.2
>            Reporter: Gautam Worah
>            Priority: Minor
>              Labels: performance
>         Attachments: wip_taxonomy_patch
>
>
> The taxonomy index that maps binning labels to ordinals was created before 
> Lucene added BinaryDocValues.
> I've attached a WIP patch (does not pass tests currently)
> Issue suggested by [~mikemccand]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to