[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-960) Index.UN_TOKENIZED overrides other tokenized fields that share the same name

John-Michael Au (JIRA) noreply at atlassian.com
Wed Oct 26 16:18:22 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44174#comment-44174 ] 

John-Michael Au commented on HSEARCH-960:
-----------------------------------------

We have a single "simple search" box for all our lists- the approach we've used is to add an additional @Field annotation for each value we want users to be able to search on. Yes, we use a single query on the "simple_search" field, as opposed to using a multi-field approach. We've found that this offers an equivalent amount of search granularity, as well as effectively hiding the need for each application to "know" the required field(s) for searching.

I'm not sure that the indexed value needs to be known before executing a query; the reason we've marked certain fields as un-tokenized is to enforce the return of complete matches (in the case of ID fields, etc.). Since indexing multiple fields with the same name is done via concatenation of tokens, it seems logical that non-tokenized values should merely be appended to whatever values were already indexed at that point.

> Index.UN_TOKENIZED overrides other tokenized fields that share the same name
> ----------------------------------------------------------------------------
>
>                 Key: HSEARCH-960
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-960
>             Project: Hibernate Search
>          Issue Type: Bug
>          Components: mapping
>    Affects Versions: 3.4.0.Final
>         Environment: 3.4.0 Final
>            Reporter: John-Michael Au
>              Labels: annotations, bug, override, tokenized, un_tokenized
>             Fix For: 3.4.2, 4.0.0.CR2
>
>
> Marking one field as un-tokenized causes all other fields with the same names to be un-tokenized.
> i.e.
> {code}
> @Field(name = "simple_search", index = Index.UN_TOKENIZED, store = Store.NO)
> private String string;
> @Field(name = "simple_search", index = Index.TOKENIZED, store = Store.NO)
> private String string2;
> {code}
> The resulting behaviour is that "simple_search" will be made up of un-tokenized 'string' and 'string2' values, even though 'string2' was specified to be tokenized.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list