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 javax.jcr.query.qom.FullTextSearch

        /**
         * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, StaticOperand)}
         */
        public void testFullTextSearch() throws RepositoryException {
            FullTextSearch ftSearch = qf.fullTextSearch(
                    SELECTOR_NAME1, propertyName1,
                    qf.literal(vf.createValue(FULLTEXT_SEARCH_EXPR)));
            assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
            assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());

            StaticOperand op = ftSearch.getFullTextSearchExpression();
            assertNotNull(op);
            assertTrue("not a Literal", op instanceof Literal);
            Literal literal = (Literal) op;
            assertEquals(FULLTEXT_SEARCH_EXPR, literal.getLiteralValue().getString());
        }
    View Full Code Here

    Examples of javax.jcr.query.qom.FullTextSearch

        /**
         * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, StaticOperand)}
         */
        public void testFullTextSearchAllProperties() throws RepositoryException {
            FullTextSearch ftSearch = qf.fullTextSearch(
                    SELECTOR_NAME1, null,
                    qf.literal(vf.createValue(FULLTEXT_SEARCH_EXPR)));
            assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
            assertNull("Property name must be null", ftSearch.getPropertyName());
        }
    View Full Code Here

    Examples of javax.jcr.query.qom.FullTextSearch

        /**
         * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, StaticOperand)}
         */
        public void testFullTextSearchWithBindVariableValue() throws RepositoryException {
            FullTextSearch ftSearch = qf.fullTextSearch(
                    SELECTOR_NAME1, propertyName1,
                    qf.bindVariable(VARIABLE_NAME));
            assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
            assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());

            StaticOperand op = ftSearch.getFullTextSearchExpression();
            assertNotNull(op);
            assertTrue("not a BindVariableValue", op instanceof BindVariableValue);
            BindVariableValue value = (BindVariableValue) op;
            assertEquals(VARIABLE_NAME, value.getBindVariableName());
        }
    View Full Code Here

    Examples of javax.jcr.query.qom.FullTextSearch

                return Collections.singleton(cn.getSelectorName());
            } else if (constraint instanceof DescendantNode) {
                DescendantNode dn = (DescendantNode) constraint;
                return Collections.singleton(dn.getSelectorName());
            } else if (constraint instanceof FullTextSearch) {
                FullTextSearch fts = (FullTextSearch) constraint;
                return Collections.singleton(fts.getSelectorName());
            } else {
                throw new UnsupportedRepositoryOperationException(
                        "Unknown constraint type: " + constraint);
            }
        }
    View Full Code Here

    Examples of javax.jcr.query.qom.FullTextSearch

        /**
         * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, String)}
         */
        public void testFullTextSearch() throws RepositoryException {
            FullTextSearch ftSearch = qf.fullTextSearch(
                    SELECTOR_NAME1, propertyName1,
                    qf.literal(vf.createValue(FULLTEXT_SEARCH_EXPR)));
            assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
            assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());
            // TODO is there some way to check the contents of a StaticOperand?
           
            // minimal test of getFullTextSearchExpression()
            StaticOperand op = ftSearch.getFullTextSearchExpression();
            assertNotNull(op);
        }
    View Full Code Here

    Examples of javax.jcr.query.qom.FullTextSearch

        /**
         * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, String)}
         */
        public void testFullTextSearchAllProperties() throws RepositoryException {
            FullTextSearch ftSearch = qf.fullTextSearch(
                    SELECTOR_NAME1, null,
                    qf.literal(vf.createValue(FULLTEXT_SEARCH_EXPR)));
            assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
            assertNull("Property name must be null", ftSearch.getPropertyName());
            // TODO is there some way to check the contents of a StaticOperand?
        }
    View Full Code Here

    Examples of javax.jcr.query.qom.FullTextSearch

        }

        @Test
        public void fullTextSearch() throws RepositoryException {
            Literal l = f.literal(vf.createValue(1));
            FullTextSearch x = f.fullTextSearch("selectorName", "propertyName", l);
            assertEquals("selectorName", x.getSelectorName());
            assertEquals("propertyName", x.getPropertyName());
            assertEquals(l, x.getFullTextSearchExpression());
            assertEquals("CONTAINS([selectorName].[propertyName], 1)", x.toString());
           
            assertEquals("CONTAINS([p], null)", f.fullTextSearch(null,  "p"null).toString());
            assertEquals("CONTAINS([s].[p], null)", f.fullTextSearch("s""p"null).toString());
            assertEquals("CONTAINS([s].*, null)", f.fullTextSearch("s",  null,  null).toString());
            assertEquals("CONTAINS(*, null)", f.fullTextSearch(null,  null,  null).toString());
    View Full Code Here

    Examples of javax.jcr.query.qom.FullTextSearch

        }

        @Test
        public void fullTextSearch() throws RepositoryException {
            Literal l = f.literal(vf.createValue(1));
            FullTextSearch x = f.fullTextSearch("selectorName", "propertyName", l);
            assertEquals("selectorName", x.getSelectorName());
            assertEquals("propertyName", x.getPropertyName());
            assertEquals(l, x.getFullTextSearchExpression());
        }
    View Full Code Here

    Examples of javax.jcr.query.qom.FullTextSearch

        /**
         * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, String)}
         */
        public void testFullTextSearch() throws RepositoryException {
            FullTextSearch ftSearch = qf.fullTextSearch(SELECTOR_NAME1, propertyName1, FULLTEXT_SEARCH_EXPR);
            assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
            assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());
            // TODO is there some way to check the contents of a StaticOperand?
        }
    View Full Code Here

    Examples of javax.jcr.query.qom.FullTextSearch

        /**
         * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, String)}
         */
        public void testFullTextSearchAllProperties() throws RepositoryException {
            FullTextSearch ftSearch = qf.fullTextSearch(SELECTOR_NAME1, null, FULLTEXT_SEARCH_EXPR);
            assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
            assertNull("Property name must be null", ftSearch.getPropertyName());
            // TODO is there some way to check the contents of a StaticOperand?
        }
    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.