vue.jselasticsearchelastic-appsearch

Elasticsearch not accepting size


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 });

 

Solution

  • 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