I'm using graphql-codegen to generate typescript type from graphql schema. I'm trying to perform wildcard operation.
query User($query: USERQueryInput){
user(query: $query){
_id
name
age
address
}
}
I want to perform wildcard search on name. I am very new in qraphql don't get any idea how to resolve it. Please help
Related
I'm trying to wildcard play.google.com like this
{
\"value\": \"play.google.com*\",\n" +
\"type\": \"wildcard\",\n" +
\"internal\": true\n" +
}
I'm using Google Account Activity to record my urls.
When I open an app via Google playstore, I am able wildcard the entries.
But when I open an app in my android, the url is like:
https://play.google.com/store/apps/details?id=com.google.android.youtube
which is not included in wildcard.
I also tried https://play.google.com/store/apps/details*.
But still no luck to avoid App openings.
Please help I'm new with Elastic Search Kibana.
I think you have a mapping issue. Wildcard query is a term-level query, which means the requested field should be a keyword type.
So, you have to provide a mapping for this field to specify that it is a keyword type. You can specify that at the index creation or with a template
I have been trying to get elasticsearch aggregations using Java High-Level Rest Client. It is always returning aggregation name with type information, for example if I have given a "terms" aggregation with name "message", the response contains the returning aggregation name as "sterms#message" which is not expected unless the user specifically asks for type information. In ElasticSearch documentation (Returning the type of the aggregation), it is mentioned that if you don't pass "typed_keys" parameter, aggregation will return with the default name, but it is not happening while using java high level rest client. While I was debugging that, I found there is no "typed_keys" check is being performed while writing the key name and aggregation name always has "type#aggregation_name". How can, I stop getting the type name in aggregation names.
The class where this default functionality is written is (ParsedAggregation.java) at line 64.
I'm using olivere's v.5 elasticsearch library - https://godoc.org/github.com/olivere/elastic
Trying to check if a particular field exists in a document. According to ES docs, it's possible - https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html
But I can't find a Go query in the library to execute that. I found the NewExistsService but I don't see a method to search by field name. I need something like
elasticClient.Exists().Field("datefield")
which returns true or false. But 'Field' is not a method of 'NewExistsService'. Any help would be appreciated.
I have a use case which is a bit similar to the ES example of dynamic_template where I want certain strings to be analyzed and certain not.
My document fields don't have such a convention and the decision is made based on an external schema. So currently my flow is:
I grab the inputs document from the DB
I grab the approrpiate schema (same database, currently using logstash for import)
I adjust the name in the document accordingly (using logstash's ruby mutator):
if not analyzed I don't change the name
if analyzed I change it to ORIGINALNAME_analyzed
This will handle the analyzed/not_analyzed problem thanks to dynamic_template I set but now the user doesn't know which fields are analyzed so there's no easy way for him to write queries because he doesn't know what's the name of the field.
I wanted to use field name aliases but apparently ES doesn't support them. Are there any other mechanisms I'm missing I could use here like field rename after indexation or something else?
For example this ancient thread mentions that field.sub.name can be queried as just name but I'm guessing this has changed when they disallowed . in the name some time ago since I cannot get it to work?
Let the user only create queries with the original name. I believe you have some code that converts this user query to Elasticsearch query. When converting to Elasticsearch query, instead of using the field name provided by the user alone use both the field names ORIGINALNAME as well as ORIGINALNAME_analyzed. If you are using a match query, convert it to multi_match. If you are using a term query, convert it to a bool should query. I guess you get where I am going with this.
Elasticsearch won't mind if a field does not exists. This can be a problem if there is already a field with _analyzed appended in its original name. But with some tricks that can be fixed too.
I have an analyser called autocomplete_analyser defined on a field name. When I run the query
http://localhost:9200/courses/course/_search?q=name:dav&pretty=true
it runs the analyser and returns the correct results. When I run
http://localhost:9200/courses/course/_search?q=dav&pretty=true
it does not.
How can I make ES run the analyser without me specifying the fields being searched on?
I need to use this analyser across a number of fields so its important that I can search all of them.
By default, queryString queries are applied on _all field which have its own analyzer.
You can define your specific analyzer for the _all field using the Put Mapping API.
Does it help?