RDoc-3912 Document Search() behavior when analyzer splits a single term into multiple tokens - #2586
Conversation
|
======================================= ====================================== ======================================= ========================================== =========================================== |
|
|
||
| * The queried index must use the **Lucene** search engine. | ||
| [Corax](../../../../../indexes/search-engine/corax.mdx#unsupported-features) does not support proximity over the `search` method, | ||
| and running such a query against a Corax index throws a `NotSupportedInCoraxException`. |
There was a problem hiding this comment.
In java the client will throw InvalidQueryException
There was a problem hiding this comment.
but
https://github.com/ravendb/ravendb/blob/d8e955bb5becaa2fc1fcb745a90daadff2fa8d15/src/Raven.Server/Documents/Indexes/Persistence/Corax/CoraxQueryBuilder.cs#L1042
throws NotSupportedInCoraxException
?
There was a problem hiding this comment.
Server indeed throws NotSupportedInCoraxException, but Java client process the exception and throws its own client exception
There was a problem hiding this comment.
The client sends where proximity(search(notes, $p0), 0), so ToCoraxQuery is invoked on the outer expression first and GetMethodType returns MethodType.Proximity - not Search. That switch has no case MethodType.Proximity, so it falls straight to default: → QueryMethod.ThrowMethodNotSupported → InvalidQueryException
| * A **proximity search** retrieves documents containing search terms that are located within a specified distance from each other. | ||
| The distance is measured by the number of intermediate terms. | ||
|
|
||
| * Proximity search is available only via [DocumentQuery](../../../../../querying/document-query/what-is-document-query.mdx) or RQL. |
There was a problem hiding this comment.
In Java proximity is available on both session.query() and session.advanced().documentQuery() APIs, or RQL
There was a problem hiding this comment.
done + added session.query() examples
|
|
||
| // Configure the index-field for FTS: | ||
| // Set 'Search' on index-field 'employeeNotes' | ||
| this.index("employeeNotes", "Search"); |
There was a problem hiding this comment.
Wrong field name. The map defines employeeData
| this.index("employeeNotes", "Search"); | |
| this.index("employeeData", "Search"); |
| @@ -439,12 +520,11 @@ const analyzerDefinition = { | |||
There was a problem hiding this comment.
RemoveWildcardsAnalyzer is not defined. The template literal above is declared as removeWildcardsanalyzer (lowercase a), so this throws a ReferenceError
also use camelCase for naming conventions in js
There was a problem hiding this comment.
Pre-existing naming slip: the prose says PutServerWideOperation, while the actual class, used in the tab right below, is PutServerWideAnalyzersOperation.
24ee88f to
6d2bab1
Compare
6d2bab1 to
ffbde2c
Compare
Issue link
https://issues.hibernatingrhinos.com/issue/RDoc-3912/Document-Search-behavior-when-analyzer-splits-a-single-term-into-multiple-tokens
Additional description
..\client-api\session\querying\text-search\content\_full-text-search-csharp.mdxAdded new section: Search with analyzer-generated phrases
..\indexes\querying\content\_searching-csharp.mdxAdded new section: Analyzer-generated phrases in static-index searches
..\indexes\content\_using-analyzers-csharp.mdxAdded info under: Analyzers at query time
Added info under: Creating custom analyzers
..\session\querying\text-search\content\_proximity-search-csharp.mdxAdded info under: Proximity search (0 distance)
..\migration\server\previous-versions-server-breaking-changes.mdxAdded new section: Full-text search when the analyzer splits a search term
Type of change
/templatesor readme)Changes in docs URLs
/scripts/redirects.jsonfile, setDocuments MovedPR label)Changes in UX/UI