Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings

Compass Support Forums » Compass » Compass Users

Thread: Query weirdness

This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Permlink Replies: 1 - Pages: 1 - Last Post: Sep 10, 2007 3:29 PM Last Post By: msolnit

Posts: 6
Registered: 8/31/05
Query weirdness
Posted: Sep 4, 2007 7:58 AM
  Click to reply to this thread Reply
Hi there,

just curious, how is it possible, that when I've got
CompassQuery q1 = session.queryBuilder().queryString(...).toQuery();
CompassQuery q2 = session.queryBuilder().queryString(q1.toString()).toQuery();

q1.hits() doesn't return anything and q2.hits() return the expected result?


Posts: 108
Registered: 10/12/06
Re: Query weirdness
Posted: Sep 10, 2007 3:29 PM   in response to: jenner in response to: jenner
  Click to reply to this thread Reply
Hi jenner. Could you provide a specific example of a query? For example, the Lucene documentation says this:

  /** Prints a query to a string, with <code>field</code> assumed to be the 
   * default field and omitted.
   * <p>The representation used is one that is supposed to be readable
   * by {@link org.apache.lucene.queryParser.QueryParser QueryParser}. However,
   * there are the following limitations:
   * <ul>
   *  <li>If the query was created by the parser, the printed
   *  representation may not be exactly what was parsed. For example,
   *  characters that need to be escaped will be represented without
   *  the required backslash.</li>
   * <li>Some of the more complicated queries (e.g. span queries)
   *  don't have a representation that can be parsed by QueryParser.</li>
   * </ul>
  public abstract String toString(String field);

-- Matt
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums