# Elasticsearch Query Expansion problem, multi-field search

**URL:** <https://discuss.elastic.co/t/elasticsearch-query-expansion-problem-multi-field-search/277729>\
**Category:** Elasticsearch\
**Created:** [July 4, 2021, 10:16am UTC](https://discuss.elastic.co/t/elasticsearch-query-expansion-problem-multi-field-search/277729 "2021-07-04T10:16:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Federico\_Bottarelli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/federico_bottarelli/32/82537_2.png) [@Federico\_Bottarelli](https://discuss.elastic.co/u/Federico_Bottarelli)\
**Post date:** [July 4, 2021, 10:16am UTC](https://discuss.elastic.co/t/elasticsearch-query-expansion-problem-multi-field-search/277729/1 "2021-07-04T10:16:17Z")

</div>

Hi guys. I'm trying to expand some queries via Blind Relevance Feedback for an Information Retrieval project using TREC evaluation system, (CORD-19 database)

I would like to use prefixes of the best terms instead of whole words. For example, the original query is

```auto
{'query': {'multi_match': {'fields': ['title', 'abstract'],
      'query': 'coronavirus origin'}}}

```

and I would like to improve the score of those documents which have, for instance, prefixes like “vacc” or “labor” in the fields title and abstract.  
I have tried many solutions, **but the score results of the documents are always the same, like there arent change in the query!**  
My last implementation was

```auto
    {'query': {'bool': {'should': [{'bool': {'should': {'multi_match': {'fields': ['title',
                                                                               'abstract'],
                                                                    'query': 'coronavirus '
                                                                             'origin'}}}},
                               {'bool': {'should': {'prefix': {'abstract': 'vacc'}}}},
                               {'bool': {'should': {'prefix': {'title': 'vacc'}}}},
                               {'bool': {'should': {'prefix': {'abstract': 'labor'}}}},
                               {'bool': {'should': {'prefix': {'title': 'labor'}}}}]}}}

```

I don’ want all the prefixes to appear in every document, but those which have at least one prefix should improve their score.  
Do you know how to do it?

Thanks,  
Christian Soraruf and Federico Bottarelli

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 1, 2021, 10:16am UTC](https://discuss.elastic.co/t/elasticsearch-query-expansion-problem-multi-field-search/277729/2 "2021-08-01T10:16:39Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
