yuuvis® RAD Q&A

0 votes
by (280 points)

Greetings,
our current search (sent as json to the search service) looks as follows:

{
 "term": "key_type:quote AND bol_quote_ungueltig:false AND dte_quote_von:<=2021-03-25 AND ((NOT _exists_:dte_quote_bis) OR dte_quote_bis:>=2021-12-31) AND (str_quote_produkt=\"Mobiltelefone\"|\"Smartwatches\")",
 "fields": [
    "quote.herkunft",
    "quote.jahr",
    "quote.produkt",
    "quote.ungueltig",
    "quote.marke",
    "quote.anderemarken",
    "quote.von",
    "quote.bis",
    "quote.quotenid",
    "quote.quoteprozent"
 ],
 "options": {
 "expertmode": true,
 "resolveReference": true,
 "tracktotalhits": true,
 "timezone": "+01:00"
 }
}

Where the goal is to find all Quoten that are defined within a specific time range and as few as possible. As we can restrict products to only needed ones we wantto reduce the amount retrieved by the search. The part

(str_quote_produkt=\"Mobiltelefone\"|\"Smartwatches\")

matches not only a Quote with the produkt "Mobiltefelone" but also "Mobiltelefone gebraucht".

Is there a way to search for the exact value only?

Kind regards
Vadim

1 Answer

0 votes
by (1.1k points)

Hello Vadim,

you don’t need to use the expert search. Especially, if you want the search to be exact. The expert search is a full text search, it’s the reason, why you get ‘Mobiltelefone gebraucht’ as a result for searching for ‘Mobiltelefone’.

For these cases we recommend to use our standard search. Your query could look like this one:

{

"filters": {
	"quote.ungueltig": {
		"o": "eq",
		"v1": false
	},
	"quote.produkt": {
		"o": "in",
		"v1": [
			"Mobiltelefone",
			"Smartwatches"
		]
	},
	"quote.bis": {
		"o": "gte",
		"v1": "2021-12-31"
	},
	"quote.von": {
		"o": "lte",
		"v1": "2021-03-25"
	}
},
"types": [
	"quote"
],
"fields": [
	"quote.herkunft",
	"quote.jahr",
	"quote.produkt",
	"quote.ungueltig",
	"quote.marke",
	"quote.anderemarken",
	"quote.von",
	"quote.bis",
	"quote.quotenid",
	"quote.quoteprozent"
],
"options": {
	"tracktotalhits": true
}

}

The option ‘tracktotalhits’ makes the query more expensive. If the amount of hits is not important, you can remove the section ‘options’ for good.

Kinds regards
Irina

by (280 points)
Thank you for the answer,
however in this scenario your request leaves out quoten where the "dte_quote_bis" is non-existant and I dont know how the standard query can accomodate for that. We want to have one request to return where the bis is later than the provided date or not set (so open ended timespan) in a single request. Using the standard query we can only extract all quotes disregarding the "bis" part and so we'd get to many unwanted results (which we would have to throw away after checking - a check which should perform significantly faster using the database instead of in our code).

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
...