lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Harwood (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-3133) Fix QueryParser to handle nested fields
Date Mon, 23 May 2011 19:13:47 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-3133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038148#comment-13038148
] 

Mark Harwood commented on LUCENE-3133:
--------------------------------------

2454 already includes extensions for the XML parser syntax and the standard QueryParser could
work the same with some added syntax. I think I've seen other languages use WITH as a keyword
e.g.
{code:borderStyle=solid}
  forename:john surname:smith WITH(employer:google AND date:2009)
{code}

In this example the WITH keyword is used to mark a clause that relates to a child document.
What is left unsaid here is how parent documents are distinguished from child docs in the
index. I guess you could 
1) Extend the WITH syntax to make it part of the query expression or
2) Make it part of the QueryParser constructor (i.e. tell the query parser what denotes parent
docs) or
3) Have a fixed system for tagging parents enforced by Lucene's IndexWriter when calling the
addDocuments API.

Option 3 seems too restrictive (it may be desirable for example to have multiple levels of
hierarchy to roll up to in an index).

The majority of users we have using this feature currently do so using a form-based query
builder which assembles the nested XML syntax behind the scenes so there is no need for extensions
to the standard QueryParser.  I can see some power users would want this though.


> Fix QueryParser to handle nested fields
> ---------------------------------------
>
>                 Key: LUCENE-3133
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3133
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>             Fix For: 3.2, 4.0
>
>
> Once we commit LUCENE-2454, we need to make it easy for apps to enable this with QueryParser.
> It seems like it's a "schema" like behavior, ie we need to be able to express the join
structure of the related fields.
> And then whenever QP produces a query that spans fields requiring a join, the NestedDocumentQuery
is used to wrap the child fields?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message