Bug Description:
Hi!
I use manticore-ts client to search through a Manticore index via HTTP API for stored shop items along with the shop's origins.
To filter out the results by shops, I'm passing an array of shops to the "must in" condition like in the code example below:
import * as Manticoresearch from 'manticoresearch-ts';
async function main() {
const serverConfig = new Manticoresearch.ServerConfiguration(
'http://my-manticore-host:9308',
{}
);
const manticoreConfig = Manticoresearch.createConfiguration({
baseServer: serverConfig,
});
const searchApi = new Manticoresearch.SearchApi(manticoreConfig);
const request = {
table: 'products_index',
query: {
bool: {
must: [
{ match: { '*': 'iPhone' } },
{ in: { origin: ['dns', 'wb'] } }
]
}
},
_source: [
'price', 'title', 'origin', 'category', 'code', 'origin_url', 'preview_img', 'description'
],
sort: [{ price: 'asc' }, '_score'],
limit: 10,
offset: 0
};
console.log('REQUEST:', JSON.stringify(request, null, 2));
try {
const data = await searchApi.search(request);
console.log('RESPONSE:', JSON.stringify(data, null, 2));
} catch (e) {
console.error('ERROR:', e);
}
}
main();
In the log, I see that the request was formed correctly:
{
"table": "products_index",
"query": {
"bool": {
"must": [
{
"match": {
"*": "iPhone"
}
},
{
"in": {
"origin": [
"dns",
"wb"
]
}
}
]
}
},
"_source": [
"price",
"title",
"origin",
"category",
"code",
"origin_url",
"preview_img",
"description"
],
"sort": [
{
"price": "asc"
},
"_score"
],
"limit": 10,
"offset": 0
}
But in fact, the client returns data without the "in" filter applied.
I added logging to isomorphic-fetch.js and got the following:
{
"table": "products_index",
"query": {
"bool": {
"must": [
{
"match": {
"*": "iPhone"
}
},
{}
]
}
},
"limit": 10,
"offset": 0,
"sort": [
{
"price": "asc"
},
"_score"
],
"_source": [
"price",
"title",
"origin",
"category",
"code",
"origin_url",
"preview_img",
"description"
]
}
It means that the actual request that goes to the Manticore server contains:
Instead of expected:
{
"in": {
"origin": [
"dns",
"wb"
]
}
Manticore Search Version:
9.3.2
Client Version:
8.0.0
Have you tried the latest development version of Manticore Search and the client?
No
Internal Checklist:
To be completed by the assignee. Check off tasks that have been completed or are not applicable.
Details
Bug Description:
Hi!
I use manticore-ts client to search through a Manticore index via HTTP API for stored shop items along with the shop's origins.
To filter out the results by shops, I'm passing an array of shops to the "must in" condition like in the code example below:
In the log, I see that the request was formed correctly:
{ "table": "products_index", "query": { "bool": { "must": [ { "match": { "*": "iPhone" } }, { "in": { "origin": [ "dns", "wb" ] } } ] } }, "_source": [ "price", "title", "origin", "category", "code", "origin_url", "preview_img", "description" ], "sort": [ { "price": "asc" }, "_score" ], "limit": 10, "offset": 0 }But in fact, the client returns data without the "in" filter applied.
I added logging to isomorphic-fetch.js and got the following:
{ "table": "products_index", "query": { "bool": { "must": [ { "match": { "*": "iPhone" } }, {} ] } }, "limit": 10, "offset": 0, "sort": [ { "price": "asc" }, "_score" ], "_source": [ "price", "title", "origin", "category", "code", "origin_url", "preview_img", "description" ] }It means that the actual request that goes to the Manticore server contains:
{}Instead of expected:
{ "in": { "origin": [ "dns", "wb" ] }Manticore Search Version:
9.3.2
Client Version:
8.0.0
Have you tried the latest development version of Manticore Search and the client?
No
Internal Checklist:
To be completed by the assignee. Check off tasks that have been completed or are not applicable.
Details