Index boosting


(ElasticSearchUser07) #1

Hi All,

I am using Elastic search for indexing search data in my application. Its a .net web application a nd i use NEST API's for indexing and searching.

Currently there are around 10 million records indexed totally in around 14 indexes. During search i use multi match search and mention the field names from all the indexes in the query and i limit the search result from elastic search to 15.

Now i need to prioritize the search like for index1, priority1 and index 2- priority 3 like this. Since there are lot of data present and i cannot re-index it now. What is the best way to add a boost to existing index? or we need to use query time boosting as i read in ES website. But how to achieve this .
Any help is really appreciated.


(ElasticSearchUser07) #2

Any help please


(Mark Harwood) #3

The REST API offers the option of per-index boosting: https://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-request-index-boost.html


(ElasticSearchUser07) #4

Thanks Mark..

Do you have a sample query? I am not sure how to fire this query


(Mark Harwood) #5
GET /test,test1/_search
{
   "query": {
	  "match": {
		 "foo": "bar"
	  }
   },
   "indices_boost": {
	  "test": 1,
	  "test1": 2.5
   }
}

I expect your next question though is "how do I do that in Nest?" but I'm not familiar with that client.


(ElasticSearchUser07) #6

Mark:
I expect your next question though is "how do I do that in Nest?" but I'm not familiar with that client.
:slight_smile: thanks a lot Mark....I actually use a raw query method in Nest, So this will do :slight_smile:


(ElasticSearchUser07) #7

I tried the above method, but didnt get it correctly. Actually the problem is i am searching 14 indices together. In one of them, there are millions of records and in others there are only around 10 or 100 records. So whenever i fire a search query, i get lot of matching results from the index which has millions of records. So the other results i am unable to figure out if its present in search results.

Ideally i would like to see results from the REST API as first few from index2 and then index3 and rest of the results from index3 (which has millions of records).


(system) #8