Closed cmoralesweb closed 8 years ago
You use 'query builder' to make query and 'query builder' has no orWhere
method yet.
But you can use raw queries (Lucene queries) without using the 'query builder'.
For example: Search::rawQuery('field1:"value1" OR field2:"value2"')->get();
OK! :+1:
orWhere()
would be a nice addition to the query builder, then.
Search by name OR description: Search::where(['name', 'description'], 'clock');
Some of my models have translated fields, like so:
I put them all on the index config, but I want the search to be language-dependent (if the user has Spanish selected, only results matching
title-es
/text-es
should appear, not the ones for -enwhere()
accepts a single field, and if you combine a couple ofwhere()
the query runs withAND
. I'd need aOR
in my case.... or perhaps there's another way that I'm missing :smile: