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

Structured search queries #368

Closed
infiniteiteration opened this issue Apr 16, 2015 · 6 comments
Closed

Structured search queries #368

infiniteiteration opened this issue Apr 16, 2015 · 6 comments

Comments

@infiniteiteration
Copy link

Is there parser for the queries for the usually used search query enhancements like: name:Tom year:2012, which would search for matching Tom in the name attribute in year 2013. Also "..." is often used and demanded by the users, which searches for exact match inside the apostrophes.

Is there a way to such strings translated to a proper query?

@karmi
Copy link
Contributor

karmi commented Apr 17, 2015

Hey, I'm not following the question? What kind of "parser"? You can either use the query_string query syntax, or the Query DSL. Have a look at the elasticsearch-dsl gem for building the search definitions programatically in Ruby.

@infiniteiteration
Copy link
Author

Hi, sorry for the late response. I was looking for this http://www.elastic.co/guide/en/elasticsearch/reference/1.x/query-dsl-query-string-query.html. I think it should be simple to formulate using elasticsearch-dsl.

@karmi
Copy link
Contributor

karmi commented May 5, 2015

@infiniteiteration That is opaque to the DSL builder -- the query syntax is a "freeform text", and in general, there shouldn't be any reason whatsoever to use it from code. There are use cases where people provide these queries. Machines should generate corresponding JSON structures.

@karmi
Copy link
Contributor

karmi commented May 12, 2015

@infiniteiteration Anything more I can can help with?

@karmi
Copy link
Contributor

karmi commented May 22, 2015

Closing.

@karmi karmi closed this as completed May 22, 2015
@infiniteiteration
Copy link
Author

Sorry for responding bit late. It's clear now, I need string-query (https://www.elastic.co/guide/en/elasticsearch/reference/1.x/query-dsl-query-string-query.html), and will provide it people, no intention to use it from the code. That's an advanced option which some users might want to take.

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