[hibernate-dev] [HSEARCH] Proposal to change the default value of Field#norms()

Sanne Grinovero sanne at hibernate.org
Wed May 9 17:54:08 EDT 2012


On 9 May 2012 21:04, Andrej Golovnin <golovnin at gmx.net> wrote:
> Hi Emmanuel,
>
>> Can you open a JIRA issue to clarify this in http://docs.jboss.org/hibernate/search/4.1/reference/en-US/html_single/#basic-mapping ?
>> Even better, can you propose the change as a GitHub pull request? :)
>
> Sure. :-)
>
>>>
>>> @Field(boost=@Boost(1.2f), norms = Norms.NO)
>>> private String description;
>>>
>>> Would I see a warning or maybe an error message from Hibernate Search?
>>> Does make such combination sense?
>>
>> I don't think we raise an exception, we should do something indeed. Do you want to open the JIRA and possibly provide a patch via a GitHub pull request?
>
> OK, I will do that. But creating patch will take some time.
>
>>> Btw Is it possible that OIDs added to index by IndexedEmbedded have
>>> norms? Luke shows me it in two different indexes. Could someone
>>> else please verify it? If it is the case, it would be nice if Hibernate Search
>>> would have the same behavior for OIDs added to index either
>>> by DocumentId or by IndexedEmbedded, e.g. index them with
>>> NOT_ANALYZED_NO_NORMS.
>>
>> I am not following you. What's an OID.
>
> Suppose you have following classes:
>
> @Entity
> public PostalAddress {
>
>    @Id
>    private String OID;
>    .....
> }
>
> @Entity
> @Indexed
> public Partner {
>
>    @Id
>    private String OID;
>
>    @OneToOne
>    @IndexEmbedded(depth = 1)
>    private PostalAddress defaultAddress;
>   ....
> }
>
> The Lucene document for Partner would contain the field
> OID from Partner indexed with NOT_ANALYZED_NO_NORMS
> and it will contain also the field "defaultAddress.OID". But the
> field "defaultAddress.OID" would have norms. This is what I see
> at least with Luke in my indexes. I think the field "defaultAddress.OID"
> should be also indexed with NOT_ANALYZED_NO_NORMS.

You're right. In fact there was a different proposal about not
indexing  "defaultAddress.OID" at all or optionally, but while that
caused some discussions and action is still unclear, let's at least
omit norms as they are definitely not needed nor expected for such a
field.. another JIRA please?

Regards,
Sanne

>
> Best regards
> Andrej Golovnin
>
>
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev



More information about the hibernate-dev mailing list