lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <paul.elsc...@xs4all.nl>
Subject Re: "Advanced" query language
Date Sun, 04 Dec 2005 16:02:28 GMT
On Sunday 04 December 2005 15:26, Erik Hatcher wrote:
> 
> On Dec 4, 2005, at 6:52 AM, Paul Elschot wrote:
> > I tried rewroting the XML query in exactly this way, with a
> > few property=.. constructs:
> >
> > boostingQuery(
> >   matchQuery=moreLikeThis(
> >                             percentTermsToMatch="0.25",
> >                             docId="44",
> >                             compareField("contents"),
> >                             compareField("title")),
> >  downGradeQuery=simpleQuery("contents")
> > ....
> > etc.
> >
> > But then I concluded that a GUI would be better for human input.
> > Nonetheless, this syntax is simpler than XML, so it might
> > be more acceptable than XML for human input.
> 
> I cannot at all fathom a use case where anything like this would be  
> human enterable.  I realize, Paul, that you're after a human- 
> enterable syntax that can create sophisticated queries, but XML  
> certainly is not appropriate, or even a short-cut of XML (see YAML -   
> http://www.yaml.org/).  It's a shame there isn't (that I can find) a  
> decent YAML parser in Java.

Are there XML editors that can limit their output to a given stylesheet?
In that case one only needs to predefine a style sheet for queries.
 
> Almost all users want to enter "words separated by spaces", and very  
> little else.  QueryParser succeeds fine for this purpose.

Those are not the users that I'm thinking of.

> I think we should focus on the machine-to-machine use case of  
> communicating a Query in this discussion.

That's ok, but when a few simple constraints are enough to
make it useful for humans that need the extra query power
enough to be willing to enter more syntax, then why not?
 
> > The problem is that query language operators form queries and have
> > properties and subqueries with possibly different roles.
> > The subqueries cause the need for nesting and the properties and roles
> > cause the need for the property=... syntax.
> 
> > I don't know XML that well. Does it have a facility to allow  
> > different roles
> > for nested constructs?
> 
> I'm not following what you mean by different roles.  Could you  
> provide an example.

For example the clauses in a boolean query can have these roles:
required, optional, and excluded.
Thinking about it, this would probably map to sth like:

<BooleanQuery>
  <BooleanClause role="required">
    <SomeSubQuery/>
  </BooleanClause>
  <!-- more clauses -->
</BooleanQuery>

Is it possible in XML to predefine rc so that <rc>...</rc> means:
<BooleanClause role="required">...</BooleanClause> ?

Regards,
Paul Elschot


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message