SOLR Multi-Criteria Query (iii)

Source: Internet
Author: User
Tags solr solr query

1. Yesterday I recorded the condition of "and" "and" (&& &&) of three conditions, again today to remember "and" "or".

Here or the situation, be sure to find out. No matter how many situations, as long as "or" appears, his level and the first input box level is the same, if we put the query conditional statement level,

The first input box is solrsql (main query statement);

The second input box is solrFQ1 (sub-query statement 1);

The third input box is solrFQ2 (sub-query statement 2);

Level:solrsql > SolrFQ1 > SolrFQ2

So the level is clear, convenient for us to splice SOLR query statements,

OK, straight to the next step. The above mentioned as long as there is or we can understand: solrsql= SOLRFQL2>SLORSQL1.

Of course, some business needs are different, may be solrsql>solrfq1=solrfq2, this demand for the results of the situation solrsql, find out and solrFQ1 or solrFQ2 situation,

Specific query code (to illustrate):

SOLRSQL:X_1457955996315_TM: "Test" + X_1457955996315_tm: "disc" + X_1457955996316_TM: "Test" + X_1457955996316_tm: "Disc"

SOLRFQ:X_1457955996315_TM: "Completed" + X_1457955996316_TM: "Completed"


2. And does not contain the situation

Rating:solrsql = solrFQ1 ! = solrFQ2

Specific query code (to illustrate):

SOLRSQL:X_1457955996315_TM: "Test" + X_1457955996316_tm: "Test"

SOLRFQ:X_1457955996315_TM: "Completed" + X_1457955996316_TM: "Completed" not X_1457955996315_TM: "disc" not X_1457955996316_TM: "Disc"


I do not know that everyone has found that the above situation except and-and-and the situation of other situations basically do not use solrFQ2, is basically in solrsq and solrFQ1 processing.

And so on, class four, level five ... N-level screening scenarios.

SOLR Multi-Criteria Query (iii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.