protected function getRequireFiltersComponent(SearchQuery $searchQuery)
    {
        $fq = array();
        foreach ($searchQuery->require as $field => $values) {
            $requireq = array();

            foreach ($values as $value) {
                if ($value === SearchQuery::$missing) {
                    $requireq[] = "(*:* -{$field}:[* TO *])";
                } elseif ($value === SearchQuery::$present) {
                    $requireq[] = "{$field}:[* TO *]";
                } elseif ($value instanceof SearchQuery_Range) {
                    $start = $value->start;
                    if ($start === null) {
                        $start = '*';
                    }
                    $end = $value->end;
                    if ($end === null) {
                        $end = '*';
                    }
                    $requireq[] = "$field:[$start TO $end]";
                } else {
                    $requireq[] = $field . ':"' . $value . '"';
                }
            }

            $fq[] = '+(' . implode(' ', $requireq) . ')';
        }
        return $fq;
    }
protected function getRequireFiltersComponent(SearchQuery $searchQuery)
    {
        $fq = array();
        foreach ($searchQuery->require as $field => $values) {
            $requireq = array();

            foreach ($values as $value) {
                if ($value === SearchQuery::$missing) {
                    $requireq[] = "(*:* -{$field}:[* TO *])";
                } elseif ($value === SearchQuery::$present) {
                    $requireq[] = "{$field}:[* TO *]";
                } elseif ($value instanceof SearchQuery_Range) {
                    $start = $value->start;
                    if ($start === null) {
                        $start = '*';
                    }
                    $end = $value->end;
                    if ($end === null) {
                        $end = '*';
                    }
                    $requireq[] = "$field:[$start TO $end]";
                } else {
                    $requireq[] = $field . ':"' . $value . '"';
                }
            }

            $fq[] = '+(' . implode(' ', $requireq) . ')';
        }
        return $fq;
    }
protected function getRequireFiltersComponent ( SearchQuery $ searchQuery ) { $ fq = array ( ) ; foreach ( $ searchQuery -> require as $ field => $ values ) { $ requireq = array ( ) ; foreach ( $ values as $ value ) { if ( $ value === SearchQuery :: $ missing ) { $ requireq [ ] = "(*:* -{$field}:[* TO *])" ; } elseif ( $ value === SearchQuery :: $ present ) { $ requireq [ ] = "{$field}:[* TO *]" ; } elseif ( $ value instanceof SearchQuery_Range ) { $ start = $ value -> start ; if ( $ start === null ) { $ start = '*' ; } $ end = $ value -> end ; if ( $ end === null ) { $ end = '*' ; } $ requireq [ ] = "$field:[$start TO $end]" ; } else { $ requireq [ ] = $ field . ':"' . $ value . '"' ; } } $ fq [ ] = '+(' . implode ( ' ' , $ requireq ) . ')' ; } return $ fq ; }
Parse all require constraints for inclusion in a filter query

@param SearchQuery $searchQuery
@return array List of parsed string values for each require
Parse all require constraints for inclusion in a filter query