How to perform a wildcard in phrase search

2014-07-31 Thread Joyce Wu
Hi,

I have a document contains a phrase interest entities.  If I use wildcard 
query to search entit*, that document is returned.  However, if I use 
wildcard query to do a phrase search interest*entit*, that document is 
not found.  I also tried with prefix query as well as wildcard query with 
interest entit*, no document is found either.   

I would expect follow query to work according to ElasticSearch document:  
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_literal_wildcard_literal_and_literal_regexp_literal_queries.html

  {wildcard:{document:interest*entit*}}

The document was indexed using standard tokenizer and standard filter, 
which should be not stemmed.

Does anyone has an idea how to get the wildcard query works with wildcard 
in a phrase?

Many thanks!


Joyce




-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/b75810bb-9e10-4dfd-aa2a-bfad63d78c27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Highlighting issue with proximity phrase match

2014-07-29 Thread Joyce Wu
 


Hi


I need to support searches like  green apple near yellow peach, but 
can't find existing query syntax from ElaticSearch to support this directly.   
So I tried to combine multiple phrase match  with a boolean query to 
achieve this.  It doesn't work perfectly, but search results are close 
enough.  However, I can't find a good way to highlight the match terms 
correctly as my client only wants to highlight the phrase green apple and 
yellow peach  where they near each other.  With the query I come up, all 
the individual word could be highlighted as well  if I have a sentence like 
green and red apple with yellow banana and pink peach, assuming somewhere 
in the text would have two phrases green apple and yellow peach that 
satisfy the query.  

 

 I use standard tokenizer with snowball filter for the text field, and  
term_vector 
with_postions_offsets is used for highlighting.

 

Here is my query:

  

query:

   {bool:{must:

  [{match_phrase:{headline:{text:green apple}}},

   {match_phrase:{headline:{text:yellow peach}}},

   {match_phrase:{headline:{text:green apple yellow 
peach,slop:10}}}

  ]

}}

highlight:

   {fields:{text:{}},

fragment_size:200,

number_of_fragments:50,

highlight_query:{match_phrase:{headline:{text:green apple 
yellow peach,slop:10}}},

require_field_match:true

}

 

I tried span near query, but I can't find span term that support phrases, 
and I believe span query only works on not-analyzed fields.

 

Can anyone have suggestions to handle the highlighting for such proximity 
phrase searches?   Thanks.
 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/18cdb5cb-3aed-4d87-95ec-2d146306117b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.