{
    "mode": "perldoc",
    "parameter": "Plucene::Search::BooleanQuery",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3ASearch%3A%3ABooleanQuery/json",
    "generated": "2026-10-08T20:56:25Z",
    "synopsis": "# isa Plucene::Search::Query\n$query->add(Plucene::Search::Query $query, $required, $prohibited);\n$query->normalize($norm);\nmy        @clauses = $query->clauses;\nmy $sumsqweights = $query->sumsquaredweights($searcher);\nmy      $asstring = $query->tostring($field);",
    "sections": {
        "NAME": {
            "content": "Plucene::Search::BooleanQuery - a boolean query\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "# isa Plucene::Search::Query\n\n$query->add(Plucene::Search::Query $query, $required, $prohibited);\n$query->normalize($norm);\n\nmy        @clauses = $query->clauses;\nmy $sumsqweights = $query->sumsquaredweights($searcher);\nmy      $asstring = $query->tostring($field);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "A query that matches documents matching boolean combinations of other\nqueries, typically TermQuerys or PhraseQuery\n\nA boolean query represents a composite query that may contains\nsubqueries of arbitrary nesting level and with composition rules such as\n'and', 'or' or 'not'.\n\nBoolean queries are represented in Plucene API by instances of the\nBooleanQuery class. Each BooleanQuery object contains a list of\nsubqueries that are linked using instances of the adaptor class\nBooleanClause. The subqueries may be of any Query type such as term\nquery, phrase query and nested boolean queries.\n\nEach sub query of a boolean query has two binary qualifiers that\ncontrols how its super query is matched. These qualifiers are\n\n*   prohibited - when this flag is set, the matching status of the\nsubquery is negated such that the query is considered as a match\nonly when the sub query does not match.\n\n*   required - when this flag is set, the sub query is required to match\n(or not to match if its 'prohibited' flag is set) for the super\nquery to match. This this is a necessary but not sufficient\ncondition for the super query to match.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "add\n$query->add(Plucene::Search::Query $query, $required, $prohibited);\n\nAdds a clause to a boolean query. Clauses may be:\n\nrequired\nwhich means that documents which *do not* match this sub-query will\n*not* match the boolean query;\n\nprohibited\nwhich means that documents which *do* match this sub-query will\n*not* match the boolean query; or\n\nneither, in which case matched documents are neither prohibited from\nnor required to match the sub-query.\n\nIt is an error to specify a clause as both required and prohibited.\n\naddclause\n$self->addclause(Plucene::Search::BooleanClause $c);\n\nAdds an already-formed clause onto the query.\n\nclauses\nmy @clauses = $query->clauses;\n\nsumsquaredweights\nmy $sumsqweights = $query->sumsquaredweights($searcher);\n\nnormalize\n$query->normalize($norm);\n\ntostring\nmy $asstring = $query->tostring($field);\n",
            "subsections": []
        },
        "POD ERRORS": {
            "content": "Hey! The above document had some coding errors, which are explained\nbelow:\n\nAround line 83:\nExpected text after =item, not a bullet\n",
            "subsections": []
        }
    },
    "summary": "Plucene::Search::BooleanQuery - a boolean query",
    "flags": [],
    "examples": [],
    "see_also": []
}