|
@@ -693,6 +693,7 @@ class ElasticsearchDelegator implements SearchDelegator<Data, ESTermsKey, ESQuer
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
initializeBoolQuery(query: SearchQuery): SearchQuery {
|
|
initializeBoolQuery(query: SearchQuery): SearchQuery {
|
|
|
|
|
+ // query is created by createSearchQuery()
|
|
|
if (query?.body?.query?.bool == null) {
|
|
if (query?.body?.query?.bool == null) {
|
|
|
throw new Error('query.body.query.bool is not initialized');
|
|
throw new Error('query.body.query.bool is not initialized');
|
|
|
}
|
|
}
|
|
@@ -756,9 +757,10 @@ class ElasticsearchDelegator implements SearchDelegator<Data, ESTermsKey, ESQuer
|
|
|
for (const phrase of parsedKeywords.phrase) {
|
|
for (const phrase of parsedKeywords.phrase) {
|
|
|
const phraseQuery = {
|
|
const phraseQuery = {
|
|
|
multi_match: {
|
|
multi_match: {
|
|
|
- query: phrase,
|
|
|
|
|
|
|
+ query: phrase, // query is created by createSearchQuery()
|
|
|
type: 'phrase' as const,
|
|
type: 'phrase' as const,
|
|
|
fields: [
|
|
fields: [
|
|
|
|
|
+ // Not use "*.ja" fields here, because we want to analyze (parse) search words
|
|
|
'path.raw^2',
|
|
'path.raw^2',
|
|
|
'body',
|
|
'body',
|
|
|
'comments',
|
|
'comments',
|