Examples of FullTextSearch

  • org.apache.jackrabbit.spi.commons.query.jsr283.qom.FullTextSearch
    Performs a full-text search.

    The full-text search expression is evaluated against the set of full-text indexed properties within the full-text search scope. If {@link #getPropertyName property} is specified, the full-text search scopeis the property of that name on the {@link #getSelectorName selector} nodein the node-tuple; otherwise the full-text search scope is all properties of the {@link #getSelectorName selector} node (or, in some implementations,all properties in the node subtree).

    Which properties (if any) in a repository are full-text indexed is implementation determined.

    It is also implementation determined whether {@link #getFullTextSearchExpression fullTextSearchExpression} isindependently evaluated against each full-text indexed property in the full-text search scope, or collectively evaluated against the set of such properties using some implementation-determined mechanism.

    Similarly, for multi-valued properties, it is implementation determined whether {@link #getFullTextSearchExpression fullTextSearchExpression} isindependently evaluated against each element in the array of values, or collectively evaluated against the array of values using some implementation-determined mechanism.

    At minimum, an implementation must support the following {@link #getFullTextSearchExpression fullTextSearchExpression} grammar:

      fullTextSearchExpression ::= [-]term {whitespace [OR] whitespace [-]term} 

    term ::= word | '"' word {whitespace word} '"'

    word ::= (A string containing no whitespace)

    whitespace ::= (A string of only whitespace)

    A query satisfies a FullTextSearch constraint if the value (or values) of the full-text indexed properties within the full-text search scope satisfy the specified {@link #getFullTextSearchExpression fullTextSearchExpression}, evaluated as follows:

    The query is invalid if:

    If {@link #getPropertyName property} is specified but, for a node-tuple,the selector node does not have a property named {@link #getPropertyName property}, the query is valid but the constraint is not satisfied.

  • @since JCR 2.0
  • org.jboss.dna.graph.query.model.FullTextSearch
    A constraint that evaluates to true only when a full-text search applied to the search scope results in positive findings. If a property name is supplied, then the search is limited to the value(s) of the named property on the node(s) in the search scope.
  • org.modeshape.jcr.query.model.FullTextSearch
    A constraint that evaluates to true only when a full-text search applied to the search scope results in positive findings. If a property name is supplied, then the search is limited to the value(s) of the named property on the node(s) in the search scope.

  • Examples of org.apache.jackrabbit.spi.commons.query.jsr283.qom.FullTextSearch

        /**
         * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, String)}
         */
        public void testFullTextSearchWithSelector() throws RepositoryException {
            FullTextSearch ftSearch = qomFactory.fullTextSearch(SELECTOR_NAME1, propertyName1, FULLTEXT_SEARCH_EXPR);
            assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
            assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());
            assertEquals("Wrong fulltext search expression", FULLTEXT_SEARCH_EXPR, ftSearch.getFullTextSearchExpression());
        }
    View Full Code Here

    Examples of org.jboss.dna.graph.query.model.FullTextSearch

                    }
                };
            }
            if (constraint instanceof FullTextSearch) {
                if (analyzer != null) {
                    FullTextSearch search = (FullTextSearch)constraint;
                    String selectorName = search.getSelectorName().getName();
                    final int locationIndex = columns.getLocationIndex(selectorName);
                    final String expression = search.getFullTextSearchExpression();
                    if (expression == null) {
                        return new ConstraintChecker() {
                            public boolean satisfiesConstraints( Object[] tuple ) {
                                return false;
                            }
                        };
                    }
                    final String propertyName = search.getPropertyName(); // may be null
                    final int scoreIndex = columns.getFullTextSearchScoreIndexFor(selectorName);
                    assert scoreIndex >= 0 : "Columns do not have room for the search scores";
                    if (propertyName != null) {
                        return new ConstraintChecker() {
                            public boolean satisfiesConstraints( Object[] tuple ) {
    View Full Code Here

    Examples of org.jboss.dna.graph.query.model.FullTextSearch

                SelectorName replacement = rewrittenSelectors.get(existence.getSelectorName());
                if (replacement == null) return existence;
                return new PropertyExistence(replacement, existence.getPropertyName());
            }
            if (constraint instanceof FullTextSearch) {
                FullTextSearch search = (FullTextSearch)constraint;
                SelectorName replacement = rewrittenSelectors.get(search.getSelectorName());
                if (replacement == null) return search;
                return new FullTextSearch(replacement, search.getPropertyName(), search.getFullTextSearchExpression());
            }
            if (constraint instanceof Between) {
                Between between = (Between)constraint;
                DynamicOperand lhs = between.getOperand();
                StaticOperand lower = between.getLowerBound(); // Current only a literal; therefore, no reference to selector
    View Full Code Here

    Examples of org.jboss.dna.graph.query.model.FullTextSearch

                if (sourceColumn == null) return existence;
                node.addSelector(sourceColumn.getSelectorName());
                return new PropertyExistence(sourceColumn.getSelectorName(), sourceColumn.getPropertyName());
            }
            if (constraint instanceof FullTextSearch) {
                FullTextSearch search = (FullTextSearch)constraint;
                if (!mapping.getOriginalName().equals(search.getSelectorName())) return search;
                Column sourceColumn = mapping.getMappedColumn(search.getPropertyName());
                if (sourceColumn == null) return search;
                node.addSelector(sourceColumn.getSelectorName());
                return new FullTextSearch(sourceColumn.getSelectorName(), sourceColumn.getPropertyName(),
                                          search.getFullTextSearchExpression());
            }
            if (constraint instanceof Between) {
                Between between = (Between)constraint;
                DynamicOperand lhs = between.getOperand();
                StaticOperand lower = between.getLowerBound(); // Current only a literal; therefore, no reference to selector
    View Full Code Here

    Examples of org.jboss.dna.graph.query.model.FullTextSearch

             * @param searchExpression the full-text search expression
             * @return the constraint builder that was used to create this clause; never null
             */
            public ConstraintBuilder search( String table,
                                             String searchExpression ) {
                return setConstraint(new FullTextSearch(selector(table), searchExpression));
            }
    View Full Code Here

    Examples of org.jboss.dna.graph.query.model.FullTextSearch

             * @return the constraint builder that was used to create this clause; never null
             */
            public ConstraintBuilder search( String table,
                                             String propertyName,
                                             String searchExpression ) {
                return setConstraint(new FullTextSearch(selector(table), propertyName, searchExpression));
            }
    View Full Code Here

    Examples of org.jboss.dna.graph.query.model.FullTextSearch

                // Followed by the full text search expression ...
                String expression = removeBracketsAndQuotes(tokens.consume());
                Term term = parseFullTextSearchExpression(expression, tokens.previousPosition());
                tokens.consume(")");
                constraint = new FullTextSearch(selectorName, propertyName, expression, term);
            } else if (tokens.canConsume("ISSAMENODE", "(")) {
                SelectorName selectorName = null;
                if (tokens.matches(ANY_VALUE, ")")) {
                    if (!(source instanceof Selector)) {
                        String msg = GraphI18n.functionIsAmbiguous.text("ISSAMENODE()", pos.getLine(), pos.getColumn());
    View Full Code Here

    Examples of org.modeshape.jcr.query.model.FullTextSearch

            SameNode same = (SameNode)and.left();
            assertThat(same.selectorName(), is(selectorName("tableA")));
            assertThat(same.getPath(), is("/a/b/c"));

            assertThat(and.right(), is(instanceOf(FullTextSearch.class)));
            FullTextSearch search = (FullTextSearch)and.right();
            assertThat(search.selectorName(), is(selectorName("tableA")));
            assertThat(search.getPropertyName(), is("p1"));
            assertThat(search.fullTextSearchExpression(), is("term1"));
        }
    View Full Code Here

    Examples of org.modeshape.jcr.query.model.FullTextSearch

            assertThat(and.right(), is(instanceOf(And.class)));
            And secondAnd = (And)and.right();

            assertThat(secondAnd.left(), is(instanceOf(FullTextSearch.class)));
            FullTextSearch search1 = (FullTextSearch)secondAnd.left();
            assertThat(search1.selectorName(), is(selectorName("tableA")));
            assertThat(search1.getPropertyName(), is("p1"));
            assertThat(search1.fullTextSearchExpression(), is("term1"));

            assertThat(secondAnd.right(), is(instanceOf(FullTextSearch.class)));
            FullTextSearch search2 = (FullTextSearch)secondAnd.right();
            assertThat(search2.selectorName(), is(selectorName("tableA")));
            assertThat(search2.getPropertyName(), is("p2"));
            assertThat(search2.fullTextSearchExpression(), is("term2"));
        }
    View Full Code Here

    Examples of org.modeshape.jcr.query.model.FullTextSearch

            SameNode same = (SameNode)or.left();
            assertThat(same.selectorName(), is(selectorName("tableA")));
            assertThat(same.getPath(), is("/a/b/c"));

            assertThat(or.right(), is(instanceOf(FullTextSearch.class)));
            FullTextSearch search = (FullTextSearch)or.right();
            assertThat(search.selectorName(), is(selectorName("tableA")));
            assertThat(search.getPropertyName(), is("p1"));
            assertThat(search.fullTextSearchExpression(), is("term1"));

        }
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. All rights reserved.
    All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.