Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default generated Elasticsearch query to something that works with > 6 #2

Closed
tryantwit opened this issue Aug 7, 2019 · 15 comments

Comments

@tryantwit
Copy link

Is your feature request related to a problem? Please describe.
The Query Sandbox section for Elasticsearch generates with the default query

{
  "query": {
    "match": {
      "_all": "#$query##"
    }
  }
}

Trying to use against Elasticsearch 6 doesn't work without changing the query due to the removal of the _all field.

Describe the solution you'd like
It would be nice if the default generated query worked off something like "multi_match" instead if the desire is to search across multiple fields. Or potentially specify a target ES version to start with a default query that works.

Additional context
Point of confusion when introducing the tool to new team members to play around with. When they generate a new relevancy case and it doesn't work immediately they get confused. The intention is usually to change the query anyway but seeming like it can't query the index at all from the get go causes some headache.

@epugh
Copy link
Member

epugh commented Aug 7, 2019 via email

@tryantwit
Copy link
Author

Sure thing. Ended up putting this in and leaving fields out to just search across whatever.

{
  "query": {
    "multi_match": {
       "query": "#$query##"
     }
   }
}

@epugh
Copy link
Member

epugh commented Aug 8, 2019

Quick update, I'm working on being able to deploy both ES 5 and ES 6, so it's easier to test different versions..

@epugh
Copy link
Member

epugh commented Aug 8, 2019

@epugh
Copy link
Member

epugh commented Aug 8, 2019

@tryantwit I tried your change, and it works great on ES 6 and 7, but doesnt' work on ES 5... Ideally our starter query works on ES 5,6, and 7.. We could add some sort of special messaging or something, but that is a pain. Any ideas on a single query?

@epugh
Copy link
Member

epugh commented Aug 8, 2019

Is 5 at this point legacy? Maybe the default path through Quepid is to assume either ES 6 or 7?

@tryantwit
Copy link
Author

Well that's great. I have no idea if 5 is legacy enough to just assume ES 6 or 7. I would assume new comers to search would end up using ES 6 or 7. I'll do some looking/thinking about a single query.

Outside of messaging we could hit the ES server to pull the version and auto default to a query but that's also a pain.

@epugh
Copy link
Member

epugh commented Aug 8, 2019 via email

@tryantwit
Copy link
Author

tryantwit commented Aug 8, 2019

Quick glance, a query_string search might work.

{
  "query": {
   "query_string": {
      "query": "#$query##"
   }
  }
}

@epugh
Copy link
Member

epugh commented Aug 8, 2019 via email

@epugh
Copy link
Member

epugh commented Aug 9, 2019

Here is a Twitter poll I am running: https://twitter.com/dep4b/status/1159553085250969601

@tryantwit
Copy link
Author

Awesome! Glad that query works across the versions. Keeps it simple. Cast my vote in the poll as well, though at this point the results might just be of personal interest.

@epugh
Copy link
Member

epugh commented Sep 26, 2019

okay, this has been fixed in #3 however not deployed yet. WOrking on deploying...

@epugh
Copy link
Member

epugh commented Nov 1, 2019

Finally have the related PR merged into master.. Will redeploy app.quepid.com on Monday.

@epugh
Copy link
Member

epugh commented Nov 6, 2019

and deployed.

@epugh epugh closed this as completed Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants