Elasticsearch not accepting size

480 Views Asked by At

So I have a search created with elasticsearch request within Vuejs that runs great and all works but as soon as I add any size/from parameters into the query I get the error "Options contains invalid key: size" but I'm unsure of where it's going wrong. I have tried changing it to a get and I have tried rebuilding the query in several different ways but keep getting the same result.

 let buildURL = 'https://blahblahblah.com/search';

        const article = { query: query.query,
                          size: 50
        };

        const headers = {
            'Authorization':'$token',
            'Content-Type':'application/json',
        };


        let querydata = await $axios.$post(buildURL, article, { headers });

 
2

There are 2 best solutions below

0
On BEST ANSWER

Options contains invalid key is not an error coming out of Elasticsearch directly. The component you're interacting with is called App Search and is a search engine layer on top of Elasticsearch.

So, all you need to change is the following:

    const article = { query: query.query,
                      page: { size: 50 }           <---- change this line
    };

That should do the trick

0
On
  1. passing of param size index option not define
  2. Or there might be another option to get size , might be limit 0,50

Share interface file