I wanting to query one term across multiple indexes, types, and fields. I've been reading and experimenting with no working solution... yet.
It's time to ask.
It works until I un-comment the second match clause. Thinking I need an OR somewhere, don't know if this is even possible. The "post" type is for the wordpress index, the "oa_basic" type is for the other three indexes. post_content and content fields map to respective types and indexes. Hope this explanation makes sense...
What have I missed or where should I be reading? Thank-you
I answered this myself. A couple of issues with the code;
php would have been overwriting the contents of the first ['body'] array element with the second. just the way php works...
I built the query in two ways; one setting array elements directly and the second where I build the array as the query clauses required. (see query code below)
I also needed to add an AND to remove the trashed wordpress posts, you can see that with the 'must_not' syntax (again, see query below)
So there you have it. The query gets results across fields, types, and indexes. And the relevancy score sets the order across these three... all good. Thanks for your eyes!
if(isset($_GET['q'])) {
$q = $_GET['q'];
}
if ($q != ''){
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.