lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <>
Subject [jira] [Updated] (LUCENE-4838) Add getOrd to BytesRefHash
Date Sun, 17 Mar 2013 07:42:14 GMT


Shai Erera updated LUCENE-4838:

    Attachment: LUCENE-4838.patch

Renamed to find and replaced all mentions of 'ord' and 'ordinal' by 'id' and 'bytesID' (depending
on context).

Simon, I couldn't use find() in add() because the lookup code modifies the hashcode given
to the method, which is later used to add the new entry. So find() needs to return two values
(the id and modified hashcode), which unfortunately we can't do. Anyway, this is not such
a long code.

I think it's ready.
> Add getOrd to BytesRefHash
> --------------------------
>                 Key: LUCENE-4838
>                 URL:
>             Project: Lucene - Core
>          Issue Type: New Feature
>          Components: core/other
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>            Priority: Minor
>         Attachments: LUCENE-4838.patch, LUCENE-4838.patch
> There is no API today to query BytesRefHash for the existence of a certain BytesRef.
Rather, you should use .add(), which looks up the given bytes, and hashes them if they are
not found, or returns their ord if they are found.
> I would like to add a simple getOrd API which will return the ord of a given BytesRef,
or -1 if not found. I would like to use that API in the facet module, and I need to be able
to query the hash without necessarily adding elements to it.
> I have a simple patch, will post shortly.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message