My users have issues with apostrophes: I need to index and search "aaa's"
as it is, and without the apostrophe, as "aaas".
If I use a char_filter to remove apostrophes when indexing and when
searching, the _analyze endpoint shows me that they produce 'words' without
apostrophes like this (respectively):
{... {
end_offset => 5,
position => 1,
start_offset => 0,
token => "aaas",
type => "word",
} }
{
end_offset => 5,
position => 1,
start_offset => 0,
token => "aaas",
type => "word",
},
But there seems to be nothing I can do to find "aaas" / "aaa's" when
searching!
My users have issues with apostrophes: I need to index and search "aaa's"
as it is, and without the apostrophe, as "aaas".
If I use a char_filter to remove apostrophes when indexing and when
searching, the _analyze endpoint shows me that they produce 'words' without
apostrophes like this (respectively):
{... {
end_offset => 5,
position => 1,
start_offset => 0,
token => "aaas",
type => "word",
} }
{
end_offset => 5,
position => 1,
start_offset => 0,
token => "aaas",
type => "word",
},
But there seems to be nothing I can do to find "aaas" / "aaa's" when
searching!
The index uses the keyword tokenizer, with edge-ngram (and other) filters —
it only wants to match from the start of the string, for autocomplete.
The search analyser is also keyword, with various filters.
The pattern-replace filter for apostrophes is applied to both.
On Tuesday, October 7, 2014 8:00:13 PM UTC+1, Ivan Brusic wrote:
What type of query are you using? Perhaps the query you are using is not
using the same analyzer at search time.
--
Ivan
On Tue, Oct 7, 2014 at 6:06 AM, Lee Gee <lee...@gmail.com <javascript:>>
wrote:
My users have issues with apostrophes: I need to index and search "aaa's"
as it is, and without the apostrophe, as "aaas".
If I use a char_filter to remove apostrophes when indexing and when
searching, the _analyze endpoint shows me that they produce 'words' without
apostrophes like this (respectively):
{... {
end_offset => 5,
position => 1,
start_offset => 0,
token => "aaas",
type => "word",
} }
{
end_offset => 5,
position => 1,
start_offset => 0,
token => "aaas",
type => "word",
},
But there seems to be nothing I can do to find "aaas" / "aaa's" when
searching!
The problem was that it was not an apostrophe, but an opening single quote.
Have increased editor font size to address this issue.
On Tuesday, October 7, 2014 8:00:13 PM UTC+1, Ivan Brusic wrote:
What type of query are you using? Perhaps the query you are using is not
using the same analyzer at search time.
--
Ivan
On Tue, Oct 7, 2014 at 6:06 AM, Lee Gee <lee...@gmail.com <javascript:>>
wrote:
My users have issues with apostrophes: I need to index and search "aaa's"
as it is, and without the apostrophe, as "aaas".
If I use a char_filter to remove apostrophes when indexing and when
searching, the _analyze endpoint shows me that they produce 'words' without
apostrophes like this (respectively):
{... {
end_offset => 5,
position => 1,
start_offset => 0,
token => "aaas",
type => "word",
} }
{
end_offset => 5,
position => 1,
start_offset => 0,
token => "aaas",
type => "word",
},
But there seems to be nothing I can do to find "aaas" / "aaa's" when
searching!
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.