Skip to content

Quick Question about cz.muni.fi.mias.search.Searching - Query String; #5

@fras2560

Description

@fras2560

For the method:

/**
     * Searches the index for query specified by string.
     *
     * @param query String with the query
     * @param print if true, results will be printed to standard output
     * @param offset index of the first retrieved result
     * @param limit number of results to retrieve
     * @param debug if true, results will contain debugging information
     *
     * @return Search result
     */
    public SearchResult search(String query, boolean print, int offset, int limit, boolean debug) {
        return search(query, print, offset, limit, debug, MathTokenizer.MathMLType.BOTH);
}

What does the query string look like?

I am sending it something like this:

<m:math>
          <m:semantics xml:id="m1.1a">
            <m:apply xml:id="m1.1.4" xref="m1.1.4.pmml">
              <m:plus xml:id="m1.1.2" xref="m1.1.2.pmml"/>
              <m:ci xml:id="m1.1.1" xref="m1.1.1.pmml">x</m:ci>
              <mws:qvar xmlns:mws="http://search.mathweb.org/ns" name="y"/>
            </m:apply>
            <m:annotation-xml encoding="MathML-Presentation" xml:id="m1.1b">
              <m:mrow xml:id="m1.1.4.pmml" xref="m1.1.4">
                <m:mi xml:id="m1.1.1.pmml" xref="m1.1.1">x</m:mi>
                <m:mo xml:id="m1.1.2.pmml" xref="m1.1.2">+</m:mo>
                <mws:qvar xmlns:mws="http://search.mathweb.org/ns" name="y"/>
              </m:mrow>
            </m:annotation-xml>
            <m:annotation encoding="application/x-tex" xml:id="m1.1c">x+\qvar@construct{y}</m:annotation>
          </m:semantics>
        </m:math>
Mean
Arithmetic

Am I on the right track? It is giving me an error however:

Exception in thread "main" java.lang.IllegalArgumentException: expected '>' at position 59
	at org.apache.lucene.util.automaton.RegExp.parseSimpleExp(RegExp.java:1128)
	at org.apache.lucene.util.automaton.RegExp.parseCharClassExp(RegExp.java:1091)
	at org.apache.lucene.util.automaton.RegExp.parseComplExp(RegExp.java:1079)
	at org.apache.lucene.util.automaton.RegExp.parseRepeatExp(RegExp.java:1048)
	at org.apache.lucene.util.automaton.RegExp.parseConcatExp(RegExp.java:1041

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions