Question about scoring

Hi there,

I build an index containing documents from different types : user, space,
content etc....The type is a field of the index.

First question

Is that possible to configure to index to get a better score if a query
match an object of a given type ?

Example : if I search 'Doe' on document titles, the user 'John Doe' should
have a better score that a blog entry named 'Jonh Doe was the first man to
land on the moon'.

Second question

If the scoring 'by type' is not possible, do ES enable us to give a better
score depending on the word distribution.

Example : if I search 'Doe' on document titles, the document 'John Doe'
should be more pertinent than the document 'Jonh Doe was the first man to
land on the moon' because for the first one, the search term represents 50%
of the words.

Am I clear ?

Thanks for your help.

Hi,
of course you are clear.
There is differents solutions to achieve what you want to do :
If you want to boost your document on certains fields you can use the
boost argument inside your term query

(there is an opened issue with an exemple Query boost not applied to numeric fields · Issue #943 · elastic/elasticsearch · GitHub)
or add a little script who check fields for boosting result.
Elasticsearch Platform — Find real-time answers at scale | Elastic

On 24 mai, 09:19, Alexandre Heimburger alexheimbur...@gmail.com
wrote:

Hi there,

I build an index containing documents from different types : user, space,
content etc....The type is a field of the index.

First question

Is that possible to configure to index to get a better score if a query
match an object of a given type ?

Example : if I search 'Doe' on document titles, the user 'John Doe' should
have a better score that a blog entry named 'Jonh Doe was the first man to
land on the moon'.

Second question

If the scoring 'by type' is not possible, do ES enable us to give a better
score depending on the word distribution.

Example : if I search 'Doe' on document titles, the document 'John Doe'
should be more pertinent than the document 'Jonh Doe was the first man to
land on the moon' because for the first one, the search term represents 50%
of the words.

Am I clear ?

Thanks for your help.

Another option is to boost certain fields at indexing time. You can set boost in the mapping, or within the doc. See: Elasticsearch Platform — Find real-time answers at scale | Elastic.
On Tuesday, May 24, 2011 at 1:02 PM, lecochien wrote:

Hi,
of course you are clear.
There is differents solutions to achieve what you want to do :
If you want to boost your document on certains fields you can use the
boost argument inside your term query
Elasticsearch Platform — Find real-time answers at scale | Elastic
(there is an opened issue with an exemple Query boost not applied to numeric fields · Issue #943 · elastic/elasticsearch · GitHub)
or add a little script who check fields for boosting result.
Elasticsearch Platform — Find real-time answers at scale | Elastic

On 24 mai, 09:19, Alexandre Heimburger alexheimbur...@gmail.com
wrote:

Hi there,

I build an index containing documents from different types : user, space,
content etc....The type is a field of the index.

First question

Is that possible to configure to index to get a better score if a query
match an object of a given type ?

Example : if I search 'Doe' on document titles, the user 'John Doe' should
have a better score that a blog entry named 'Jonh Doe was the first man to
land on the moon'.

Second question

If the scoring 'by type' is not possible, do ES enable us to give a better
score depending on the word distribution.

Example : if I search 'Doe' on document titles, the document 'John Doe'
should be more pertinent than the document 'Jonh Doe was the first man to
land on the moon' because for the first one, the search term represents 50%
of the words.

Am I clear ?

Thanks for your help.