Elasticsearch: Replacement for Fuzzy Like This Query Deprecation - elasticsearch

Reference to this link it said that the Fuzzy Like This (also Fuzzy Like This Query) will be deprecated in ES version > 1.6, and completely remove in version 2.
I'm using Elasticsearch version 1.5.1 and using a lot of FLT statement in my search query. I would like to upgrade the ES version to the current latest (1.7), but I could not find any suggest about FLT replacement when move to newer version? So I would like to ask, if any. And is it possible to use it when it is deprecated?

I found the following recommendation in the Elasticseach reference
:
The fuzzy_like_this or flt query has been removed. Instead use the fuzziness parameter with the match query or the More Like This Query.
Deprecated means that you can still use this feature without issues as long as you don't upgrade to version 2 or higher. I'm using version 1.7.1 and flt works fine. But the feature will no longer exist in version 2.x. For more details why they decided to remove it you can have a look at the relevant github thread.

I've run into the same problem. I borrowed a solution discussed on github https://github.com/elastic/elasticsearch/pull/10391
{
"multi_match" : {
"fields" : ["_all"],
"query" : "your search text",
"fuzziness" : "AUTO"}
}
multi_match has a number of other parameters you can use to improve the result.

Related

ElasticSearch 5.6 > 7.x Upgrade, is there an auto_generate_phrase_query Equivalant?

I'm upgrading my codebase's ElasticSearch from 5.6 to 7.x due to some features I'd like to explore.
I'm currently using GoLang & "github.com/olivere/elastic/v5" specifically.
However, auto_generate_phrase_query has been depreciated, and AutoGeneratePhraseQueries no longer works on v7 ("github.com/olivere/elastic/v7").
I've read to use explicit quoted queries, what is the equivalent to that in olivere? is there no setting i can set to true/false in ES when making requests to achieve this? Must i explicitly wrap my queries in quotation marks? Surely there must be a proper way to do this...
I found this: https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-query-string-query.html
which states use [type=phrase] instead
In Olivere, i can set this via: Type("phrase"); is this a sufficient alternative?
The closest thing was actually using Phrase Queries. For anyone in the future coming back to find an answer.

ES 1.7.5 How to mimic match_none behavior?

Match_none was introduced in later versions, but there has to be a way to mimic the behavior in 1.7.5? Any leads would be appreciated.
Basically, I want to return a query which will match no documents, but my global aggregations would still run.
Found out I can use MustNot in combination with MatchAll (must not match all)

can i backport "pattern_replace" char filter into elasticsearch 0.19.9?

our system is running elasticsearch 0.19.9.
recentyly i'm going to add a new mapping on it. what i need is merge multiple whitespaces into a single whitespace.
i do some search ,and find pattern_replace is what i need, code are like
"space_filter":{
"type":"pattern_replace",
"pattern":"\\s+",
"replacement":"\\s"
}
but the bad news is "pattern_replace" is not introduced until 0.90.*. so is there possibily to backport this function into the version i'm using?
really i don't want to upgrade this system the newest version, guessing it's time consuming, as i'm also using es-head and bigdesk. the version match thing might kill me.

Does Jackrabbit support the XPath union (|) operator?

I am trying to search under 2 different nodes for a specific name. This works
/jcr:root/db067409/libraries/bd0b868d/_x0030_//*[#name="FIRST"]
But when I try to OR it with the second node like so...
/jcr:root/db067409/libraries/bd0b868d/_x0030_//*[#name="FIRST"]|/jcr:root/db067409/libraries/_x0033_78d57e4/_x0031_//*[#name="FIRST"]
I no longer get any search results. Please could someone point out what I've done wrong.
What I'd really like to do is along these lines; if I have /a/b/ID1/VERSION1 and /a/b/ID2/VERSION2 I'd like an xpath something like this /a/b/(ID1/VERSION1 or ID2/VERSION2)//*[#name="some name"].
Answer is no. Unfortunately, it doesnt throw an UnsupportedOperationException like you'd expect. There was an item in Jira but I guess they ignored it as Xpath is now deprecated.
Use JCR_SQL2 if you do need a union.
Edit
This thread indicates that a union-like feature is available in Jackrabbit 2.0, but not earlier.
[Joins] are not possible with JCR
Xpath or JCR-SQL, but with the new query model in JCR 2.0 (JCR-SQL2).
This is supported since CQ 5.3 / CRX 2.0 / Jackrabbit 2.0. Please note
that these joins aren't optimized very much.
Indeed, XPath is deprecated in JCR 2.0.
JCR 1.0 defines a dialect of SQL different from JCR-SQL2, as well as a dialect of XPath. Support for these languages is deprecated.

Lucene.NET MatchAllDocsQuery doesn't honor document boost?

I have a Lucene index of document, all nearly identical (test 1, test 2, etc.) except that some have a higher boost than others. When using a default query (MatchAllDocsQuery OR .Parse(":") on the query parser) the documents come back in the order they went in every time. By adding a search term ("test" in this case), the document boost is apparent and the documents are sorted according to the boost. I can change the boost levels around and the new order is reflected in the results. All my code is pretty standard fair, I'm using a default Sort() is both cases.
I found that this same bug was reported and fixed in Lucene back in 2005-2006, and I checked my MatchAllDocsQuery.cs file (Lucene .NET 2.9.2) and it seems to have this change present, but the behavior is as described in the ticket above.
Any ideas what I might be doing wrong? Perhaps someone running the Java version has experienced this (or not)? Thanks.
Uh, don't I feel silly now. This is as-designed behavior. I guess. According to Lucene in Action, MatchAllDocsQuery uses a constant for the boost.

Resources