问题
I've moved my SOLR core documents to ElasticSearch index. Now I need to convert my SOLR query parameters to ES format. I've seen the ES documentation here https://www.elastic.co/guide/en/elasticsearch/reference/current/search-uri-request.html but ES doesn't have all the URI query parameters with name like fq, group, boost, facet etc.
From the documentation I came know below query parameters mapping between SOLR and ES. May be I am missing others, Please let me know those.
SOLR to ES : fl -> _source, q -> q, rows -> size, start -> from, sort->sort
I know that I can use the query string of ES with the source parameters but I don't want to use that(because then I need to change a lot of my current system). See the answer of @Val here Convert Elasticsearch kibana query string format to URI Search format
My final Goal is to convert the below SOLR query with ES but using URI search parameters not the query string. These all parameters I can set on URI search for SOLR
{
"facet": "true",
"sort": "",
"facet.mincount": "1",
"indent": "true",
"facet.limit": "-1",
"group.limit": "48",
"wt": "json",
"rows": "48",
"fl": "id,code:feed_provider_id,feed_provider_id,feed,property_name,pax:occupancy,bedroom_count,min_stay,star_rating,night_rate_min,currency,picture:feature_image,latlon,image_count,display,parent_path,categories,rating,min_stay,archived,feed_provider_url,featured,direct,rating,ha_24_hour_response_s,base_usd_currency:currency(night_rate_min,'USD')",
"facet.query": "{!key='Other'}(-property_type_categories:*)",
"start": "0",
"q": "(((latlon:[48.815573,2.225193 TO 48.9021449,2.4699208]) AND (country:france OR country:FRANCE OR country_code:FR OR country_code:fr)) OR (parent_path:*,187147,* OR location_id:187147))",
"group.field": "feed",
"facet.field": [
"amenity_category",
"property_type_categories"
],
"group": "true",
"group.offset": "0",
"fq": [
"-latlon:0.001,0.001",
"published:1",
"night_rate_min:[0.01,USD TO 100000,USD]",
"feed:11 OR feed:12 OR feed:13 OR feed:14",
"night_rate_min:[75,EUR TO 250,EUR]",
"-booked_date:[2018-02-23T00:00:00Z TO 2018-02-26T00:00:00Z] AND min_stay:[* TO 3]",
"occupancy:[3 TO *]",
"property_type_categories:('cabin' OR 'house')"
]
}
So, my basic question is
Is this possible to fully convert my above SOLR query to ES format using URI search parameters?
or
I need to use both URI search and query string parameters?
Please suggest me how can I covert my current queries on ES format?
来源:https://stackoverflow.com/questions/48406843/convert-solr-query-to-elasticsearch-uri-format