How to index and search for URLs?

(Barak Yaish) #1

I'm using the JAVA API to index the documents, one of the properties
is a URL (for example:
). When trying to search the index by url, I get zero results in the

XContentQueryBuilder xcqb = QueryBuilders.fieldQuery( "url", "http://" );

SearchResponse response = client.prepareSearch("edgecache")

System.out.println( response.getHits() ); //empty hits

I guess this is due the special chars appear (: or ? when there is
query string, etc.). I didn't understand from the docs how should one
configure the proper analyzer, can you please help with detailed
example? Is this configurable by the JAVA API or environment vars?


(system) #2