Hello,
Sorry to disturb you but I'm totally blocked, I'm french student and I work on a project in my company.
I want to make a query in c# on elasticsearch.
The adress which I can have a json response is:
X.X.X.X:5602/elasticsearch/collector_reparation_*/reparation/_search
I would like to do something like:
Uri node = new Uri("http://X.X.X.X:5602/elasticsearch/");
ConnectionSettings settings = new ConnectionSettings(node);
settings.SetDeafultIndex("collector_reparation_*);
var searchResponse = client.Search..????? nothing works
I'm totally distraught even with the official doc.
Can someone help me to improve please?
I would like to recover all the 'reparations' whose 'etat' = 'effectué' in format raw json (or serialized)
Without Stepping in @forloop toes and I would wait on his guided response!
My limited knowledge and lack of more info might suggest this?
var settings = new ConnectionSettings(new Uri("http://x.x.x.x:5602")).DefaultIndex("collector_reparation_*").DefaultTypeName("reparation");
var client = new ElasticClient(settings);
var searchResponse = client.Search<Reparation>(s => s
.Query(q => q
.Match(m => m
.Field(f => f.Etat)
.Query("effectué")
)
)
);
var responseJson = searchResponse;
public class Reparation
{
public string Etat { get; set; }
}
Hope this helps in any way possible
I assumed in your URI that "ElasticSearch" was the cluster.name (I left it out since I dont know how to specify a Cluster.Name in the Connectionstring, that all index searched start with "collector_reparation_" , "reparation is a Type and you have a string field called "etat" in your index.
Here some info in connecting to a node not in (localhost:9200) Connecting
Choosing the right connection strategy
Sorry I can't be of more help..
Thank you very much and sorry to answer so late.
It's very nice for you to give me some time.
I'm going back to my company on Monday and I will try it.
I will let you know.
Thanks!!!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.