If all you need is querying, I will highly recommend looking at
https://github.com/CenturyLinkCloud/ElasticLINQ for .NET

I also have my own stab at a .NET client library for Elasticsearch here:
https://github.com/synhershko/NElasticsearch /
https://www.nuget.org/packages/NElasticsearch/1.0.14 (still WIP)

--

Itamar Syn-Hershko
http://code972.com | @synhershko <https://twitter.com/synhershko>
Freelance Developer & Consultant
Author of RavenDB in Action <http://manning.com/synhershko/>

On Fri, Jan 9, 2015 at 7:54 PM, Garrett Johnson <[email protected]>
wrote:

> { query = this.textBox1.Text,
>
> default_field = "_all"
>
> },
>
> This seems to send it.  Still don't know how to get the results.
>
> It's like it should be in a foreach(hit in hits) {get fields}  but I have
> nothing and documentation isn't helping.
>
>
> On Friday, January 9, 2015 at 12:43:36 PM UTC-5, Garrett Johnson wrote:
>
>> Hi All,
>>
>> I would like to use Elasticsearch.Net (NEST requires types and I do not
>> want strong types) to do a simple _all term search.  I can do this using
>> the plugin elasticsearch head and I retrieve the appropriate documents.
>> Here is some simple code I wrote just to say hey give me all that match.
>>
>> var node = new Uri(http://myhost:9200);
>>
>> var config = new ConnectionConfiguration(node);
>>
>> var exposed = config.ExposeRawResponse(true);
>>
>> var client = new ElasticsearchClient(config);
>>
>> var search = new
>>
>> {
>>
>> size = 10,
>>
>> from = 1 * 10,
>>
>> query = new { query_string = new { query = this.textBox1.Text } },
>>
>> };
>>
>> var searchResponse = client.Search("jdbc",search);
>>
>> This returns these results:
>>
>> {StatusCode: 200,
>>  Method: POST,
>>  Url: http://u4vmeqlditapp01:9200/jdbc/_search,
>>  Request: {"size":10,"from":10,"query":{"query_string":{"query":"Garrett"}}},
>>
>>  Response: {"took":5,"timed_out":false,"_shards":{"total":5,"
>> successful":5,"failed":0},"hits":{"total":10,"max_score":
>> 1.1672286,"hits":[]}}}
>>
>> But no documents.
>>
>> Here is the JSON I'm trying to replicate:
>>
>>
>>
>>    - "query": {
>>       - "bool": {
>>          - "must": [
>>             - {
>>                - "query_string": {
>>                   - "default_field": "_all",
>>                   - "query": "Garrett"
>>                }
>>             }
>>          ],
>>          - "must_not": [ ],
>>          - "should": [ ]
>>       }
>>    },
>>    - "from": 0,
>>    - "size": 25000,
>>    - "sort": [ ],
>>    - "facets": { }
>>
>>
>> I'm pretty sure it is because the query doesn't have the default_field
>> set to _all... But I don't know how to set that.  I've tried several string
>> concatenations to no avail.... it just searched for them.
>>
>> Any one with any ideas.  I want to simply search all types for a single
>> string.
>>
>> Garrett
>>
>>
>>
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/c7be81ac-d3ff-4841-b458-41aae34df921%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/c7be81ac-d3ff-4841-b458-41aae34df921%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtOWzNT6to0H5ahDooJ-J%3DAgLhRcJxdJwUwCB3i7wjLeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to