Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Document Boosting migration query #397

Open
NikRimington opened this issue Nov 19, 2024 · 1 comment
Open

[Question] Document Boosting migration query #397

NikRimington opened this issue Nov 19, 2024 · 1 comment
Labels

Comments

@NikRimington
Copy link

NikRimington commented Nov 19, 2024

Hi Shannon,

I'm hoping you can point me in the right direction, more accurately help me make sense of the Lucene docs.
I'm currently working on an Umbraco v13 (examine version 3.3.0) site and trying to replicate some behaviour from a v8 site.

The behaviour in question is hooking into the DocumentWriting Lucene event and applying a document level boost based on a variety of different factors.

I've seen in the Lucene documentation for v4.8.0 beta 16, that the Boost property on a document has been removed and it says the following:

If you previously used the setter of Document.Boost, you must now pre-multiply the document boost into each Field.Boost. If you have a multi-valued field, you should do this only for the first Field instance (ie, subsequent Field instance sharing the same field name should only include their per-field boost and not the document level boost) as the boost for multi-valued field instances are multiplied together by Lucene.

(src: just above this heading https://lucenenet.apache.org/docs/4.8.0-beta00016/api/core/migration-guide.html#other-changes )
My question is, would you be able to explain what this actually means, I don't really understand what they are saying or how I would implement this so hoping that you might be able to explain it in a different manner (maybe, if I'm lucky) with a couple of small code snippets?

Thanks,

Nik

@Shazwazza
Copy link
Owner

Hey @NikRimington,

Lucene 4+ no longer supports applying boosts at the document level so you cannot do that anymore. If you want to apply boosts you can just boost as part of your query, or, it is possible to apply boosts at the Document/Field level during indexing as the doc suggests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants