ChemPal Documentation - v1.6.0
    Preparing search index...

    Module utils/search-query/extractPositiveTerms

    Search - Utils

    extractOrGroups

    Extracts the positive (non-negated) OR-groups from a query tree as a disjunctive-normal-form-ish list: the outer array is OR-ed alternatives, and each inner array is an AND-group of phrases. Negated branches are dropped, since a keyword-only backend has nothing positive to search for in them.

    extractAllPositiveTerms

    Flattens a query tree to its unique positive (non-negated) terms. Used by backends that only offer a single OR-ish full-text search field (e.g. Magento search): send all positive terms as one query to get a broad candidate pool, then refine with the client-side boolean predicate.