I've been looking into putting weight on a select number of fields for my
project. I thought that doing fieldname^weight would work but it doesn't
unfortunately. I know I read somewhere that using caret would do the
tricky.
My main goal is to ensure that the relevancy algorithm would consider
putting a lot of weight in keywords matching the title than the *contents
I've been looking into putting weight on a select number of fields for
my project. I thought that doing fieldname^weight would work but it
doesn't unfortunately. I know I read somewhere that using caret would
do the tricky.
My main goal is to ensure that the relevancy algorithm would consider
putting a lot of weight in keywords matching the title than the
contents fields.
You can combine queries with the bool or dismax query, and give each
query different weights, eg:
Thanks for the insight. I am using FuzzyLikeThis query so fields are defined
as a group so the structure is a bit different. Having said, my initial
strategy is to set the boost value of a field when defining the mapping. It
seems to work just fine. I'm just looking for ways to set field weight at
query-time for FLT queries specifically.
Thanks for the insight. I am using FuzzyLikeThis query so fields are
defined as a group so the structure is a bit different. Having said,
my initial strategy is to set the boost value of a field when defining
the mapping. It seems to work just fine. I'm just looking for ways to
set field weight at query-time for FLT queries specifically.
With the fuzzy-like-this query, you specify a list of fields, and you
can specify the boost for each field as follows:
I'm running into the same issue. I wanted to make a AND query with
different boosts for different fields. So let's say I'm searching across
fields 'title' and 'body' the words 'foo' 'bar' 'baz'. I only want to
return documents that have ALL words, but want to give a preference to the
title. So for example: foo & bar in title and baz in body gets a higher
score than only foo in title and bar & baz in body. But I don't want a
document that would not have ALL the terms. Any idea?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.