Skip to content

Commit

Permalink
#19 add match query
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillsinyuk committed Feb 20, 2024
1 parent 008117f commit 239da2e
Showing 1 changed file with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,43 @@ import org.springframework.data.elasticsearch.annotations.Query
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository

interface ElasticDealRepository : ElasticsearchRepository<Deal, String> {
@Query(query = "{ \"multi_match\" : {\"query\" : \"?0\" }}")
@Query(
query = """{
"bool": {
"should": [
{
"multi_match" : {
"query": "?0",
"type": "cross_fields",
"fields": ["sellers.name.firstName", "sellers.name.lastName", "sellers.name.middleName"],
"operator": "and"
}},
{
"multi_match" : {
"query": "?0",
"type": "cross_fields",
"fields": ["buyers.name.firstName", "buyers.name.lastName", "buyers.name.middleName"],
"operator": "and"
}},
{
"multi_match" : {
"query": "?0",
"type": "cross_fields",
"fields": ["guarantors.name.firstName", "guarantors.name.lastName", "guarantors.name.middleName"],
"operator": "and"
}},
{
"match_phrase_prefix": {
"number": {
"query": "?0",
"max_expansions": 10000
}
}
}
]
}
}""",
)
fun searchAll(
search: String,
page: Pageable,
Expand Down

0 comments on commit 239da2e

Please sign in to comment.