Snowball (expected) search

I've been investigating the snowball analyzer in an attempt to create a
search function that works as most users would expect a search function to.

I know that this post could create a lot of conflicting replies, but lets
dive right in.

I've added the following analyzer:

"snowballanalyzer" : {
"type":"snowball",
"language" : "English",
"stopwords" : ""
}

Lets say I index the following text in a field of a document:

"The quick brown fox jumps over the lazy dog".

I'd like the following queries to return the document:
quick brown
the quick brown
jump fox
foxes dogs

And the following queries to not return anything:
quick red
all quick brown

I'm using the Java API with the following code:

boolFilterBuilder.must(FilterBuilders.queryFilter(QueryBuilders.fieldQuery("Message",
query)));

There aren't many tutorials or samples that provide examples of which
queries will return which results. Hopefully someone can shed some light on
how this generic search functionality can be achieved.

Thanks to anyone that replies.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

You have used a filter, but where is the query? Please can you gist or
post the whole Java code so we can see what you do?

Jörg

Am 31.03.13 16:58, schrieb marcuslongmuir:

boolFilterBuilder.must(FilterBuilders.queryFilter(QueryBuilders.fieldQuery("Message",
query)));

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

The query variable is a string containing one of the examples I've posted
above.

The implementation code is rather convoluted due to branching logic, but
I'll post a condensed block.

String query = "quick brown";

BoolFilterBuilder boolFilterBuilder = FilterBuilders.boolFilter();

boolFilterBuilder.must(FilterBuilders.queryFilter(QueryBuilders.fieldQuery(
"Message", query)));

SearchRequestBuilder searchRequestBuilder = client.prepareSearch("myindex")
.setFilter(boolFilterBuilder)
.setSearchType(SearchType.QUERY_THEN_FETCH)

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.