We are stuck in a situation where we need to search exact hyphen query and
others as wildcard query. We have 3 document type in our index
customer,quotation, and devices respectively. We are allowing user to
serach on minimum 4 characters hence we need to use wildcard.
The problem is quotation number contains hyphen "-" and we have to search
the complete data for e.g. "QNMP-1900" should not be searched as QNMP and
1900. That means if I search for "QNMP-19" then is should search for all
records start with QNMP-19.
Rest search query should also works with wildcard. I have tried keyword
analyzer, not_analyzed and token but no luck. I tried query_string and text
query but the result is breaking string based on hyphen.
We are stuck in a situation where we need to search exact hyphen query and
others as wildcard query. We have 3 document type in our index
customer,quotation, and devices respectively. We are allowing user to
serach on minimum 4 characters hence we need to use wildcard.
The problem is quotation number contains hyphen "-" and we have to search
the complete data for e.g. "QNMP-1900" should not be searched as QNMP and
1900. That means if I search for "QNMP-19" then is should search for all
records start with QNMP-19.
Rest search query should also works with wildcard. I have tried keyword
analyzer, not_analyzed and token but no luck. I tried query_string and text
query but the result is breaking string based on hyphen.
On Fri, Dec 7, 2012 at 4:03 PM, aps <pushka...@gmail.com <javascript:>>wrote:
Hi All,
We are stuck in a situation where we need to search exact hyphen query
and others as wildcard query. We have 3 document type in our index
customer,quotation, and devices respectively. We are allowing user to
serach on minimum 4 characters hence we need to use wildcard.
The problem is quotation number contains hyphen "-" and we have to search
the complete data for e.g. "QNMP-1900" should not be searched as QNMP and
1900. That means if I search for "QNMP-19" then is should search for all
records start with QNMP-19.
Rest search query should also works with wildcard. I have tried keyword
analyzer, not_analyzed and token but no luck. I tried query_string and text
query but the result is breaking string based on hyphen.
We are stuck in a situation where we need to search exact hyphen query
and others as wildcard query. We have 3 document type in our index
customer,quotation, and devices respectively. We are allowing user to
serach on minimum 4 characters hence we need to use wildcard.
The problem is quotation number contains hyphen "-" and we have to
search the complete data for e.g. "QNMP-1900" should not be searched as
QNMP and 1900. That means if I search for "QNMP-19" then is should search
for all records start with QNMP-19.
Rest search query should also works with wildcard. I have tried keyword
analyzer, not_analyzed and token but no luck. I tried query_string and text
query but the result is breaking string based on hyphen.
If I understand the problem your searches for XXX-999 are being tokenized into two separate tokens? The standard tokenizer will do that, I believe I use the whitespace tokenizer to avoid that issue.
I am using global search where not_analyzed required term query. As I
specified I have 3 document type and I am searching on all.
Please check the query which I am using directly on index.
We are stuck in a situation where we need to search exact hyphen query
and others as wildcard query. We have 3 document type in our index
customer,quotation, and devices respectively. We are allowing user to
serach on minimum 4 characters hence we need to use wildcard.
The problem is quotation number contains hyphen "-" and we have to
search the complete data for e.g. "QNMP-1900" should not be searched as
QNMP and 1900. That means if I search for "QNMP-19" then is should search
for all records start with QNMP-19.
Rest search query should also works with wildcard. I have tried keyword
analyzer, not_analyzed and token but no luck. I tried query_string and text
query but the result is breaking string based on hyphen.
This query is searching the _all field which by default combines all fields
in your documents into a single field which is analyzed by the default
analyzer. You need to search individual fields (not _all) for the field
specific analyzer to be applied.
On Monday, December 10, 2012 2:54:15 AM UTC-5, aps wrote:
I am using global search where not_analyzed required term query. As I
specified I have 3 document type and I am searching on all.
Please check the query which I am using directly on index.
We are stuck in a situation where we need to search exact hyphen query
and others as wildcard query. We have 3 document type in our index
customer,quotation, and devices respectively. We are allowing user to
serach on minimum 4 characters hence we need to use wildcard.
The problem is quotation number contains hyphen "-" and we have to
search the complete data for e.g. "QNMP-1900" should not be searched as
QNMP and 1900. That means if I search for "QNMP-19" then is should search
for all records start with QNMP-19.
Rest search query should also works with wildcard. I have tried
keyword analyzer, not_analyzed and token but no luck. I tried query_string
and text query but the result is breaking string based on hyphen.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.