Search Analyzer Not Working

Hi

I am trying to search on URL type field , created a custom analyzer with
tokenizer as uax_url_email , and indexedit with the same.
i have explicitly specified the "index_analyzer" and "search_analyzer"
fields while creating the mapping, as the same custom analyzer.

As per my understanding , the uax_url_email tokenizer , recognizes the
string as an Email or an URL , but does not breaks it further.
So , since the whole string is preserved as a single token , wild card
Queries should work on it.
They do work in some cases like when i search for
www.englishdictionary.fr
but fail when i do a search for www.englishdictionary.fr/hann
and an Parsing Exception is thrown .

Since i have explicitly specified the "search_analyzer" as the custom
analyzer , my query_string is supposed to be analyzed in the way defined in
the analyzer specified., i.e any url will not be tokenized by being broken
into smaller components.

I also checked with the curl Command , to check the fuctioning of the
custom analyzer, and as expected , it's showing me the complete URL as a
single token.
but while searching throgh java API, a parsing exception is being thrown.

I also tried setting the analyzer as "uax_url_email1" (custom analyzer's
name) with the query , and also tried setting analyzeWildcard = false , but
to no avail , still the query fails.

Below is the link for the Gist
https://gist.github.com/F-Torres/5711570

  1. Please also suggest how to search for wildcards in the URL , if it
    already contains wildcard characters like ? and * , ( while keeping the URL
    field not analyzed / Keyword Analyzer / Custom Analyzer with uax_url_email
    tokenizer )

Exception being thrown : -

org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to
execute phase [dfs], total failure; shardFailures
{[27tA5ursT6CQbjmx1FFSsQ][html][1]: SearchParseException[[html][1]:
from[-1],size[10000]: Parse Failure [Failed to parse source
[{"size":10000,"query":{"query_string":{"query":"*
www.englishdictionary.fr/hann*","fields":["urls"],"analyzer":"uax_url_email1"}},"fields":""}]]];
nested: QueryParsingException[[html] Failed to parse query [

www.englishdictionary.fr/hann*]]; nested: ParseException[Cannot parse '*
www.englishdictionary.fr/hann*': Lexical error at line 1, column 32.
Encountered: after : "/hann*"]; nested: TokenMgrError[Lexical error
at line 1, column 32. Encountered: after : "/hann*"];
}{[27tA5ursT6CQbjmx1FFSsQ][html][3]: SearchParseException[[html][3]:
from[-1],size[10000]: Parse Failure [Failed to parse source
[{"size":10000,"query":{"query_string":{"query":"*
www.englishdictionary.fr/hann*","fields":["urls"],"analyzer":"uax_url_email1"}},"fields":""}]]];
nested: QueryParsingException[[html] Failed to parse query [

www.englishdictionary.fr/hann*]]; nested: ParseException[Cannot parse '*
www.englishdictionary.fr/hann*': Lexical error at line 1, column 32.
Encountered: after : "/hann*"]; nested: TokenMgrError[Lexical error
at line 1, column 32. Encountered: after : "/hann*"]; }
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:260)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:213)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteDfs(SearchServiceTransportAction.java:110)
at
org.elasticsearch.action.search.type.TransportSearchDfsQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchDfsQueryThenFetchAction.java:86)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

Please Help .

--
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.