Ok Olivier, Thank you very much for this help.

Just another 2 words :
- I know the behaviour I am expecting is kind of "unnatural", and that the 
plugin has surely not been designed in order to fill that need
- I understood the way to get a solution to my problem, and thank you for the 
few tips, but there is just one thing I could not get :
" and then use the myprefix:myindexedfield = 'lucene' query."

Where is that configuration ? Are you talking about the operator in the 
contribution to QueryModelService :

<queryModel name="byCustomNavQueryModel" docType="Custom_QueryNav">

     <max>10</max>
      <whereClause>

        <predicate parameter="th myprefix:myindexedfield " operator="FULLTEXT 
ONE OF">
          <field schema="querynav" name="subjects" />
        </predicate>
</queryModel>

Thank you very much for the time you devoted to my problem.

-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Olivier Grisel
Envoyé : lundi 15 septembre 2008 16:59
À : [email protected]
Objet : Re: [Ecm] Plugin VirtualNavigation : which query is processed ?

I reply again here since I made a mistake with my mail client at first, sorry
for any duplicated message.

Romain Delalande a écrit :
> > Okay, I don't think I explained my problem very well.
> >
> > I downloaded the plugin sources, and I rebuild it with my custom 
> > development.
> > Consequently, of course I contributed with a new schema and QueryModel to
the suitable extension points.
> > I did that right, I think : I created my query schema (and then its
coretype), I contributed to the DirectoryTreeService, to the QueryModelService,
the ResultsProvideService, I modified the deplyment-fragment ...
> >
> > As a result, I can see, in the UI, my tree, i can explode each category, ...
the tree is okay. No problem
> >
> > To be precise, here are my data : think that "categories" are basic
programming languages, and "subcategories" are frameworks.
> > Lucene can be both in Java and PHP.
> >
> > So, the data are :
> > - JAVA :
> >         > lucene
> >         > nuxeo
> > - PHP :
> >         > pear
> >         > lucene
> > [...]
> > Everything seems to work ok, except for my specific need :
> > If I try to browse category "PHP", then click on subcategory "Lucene", I
want all documents containing subcategory "Lucene" (including both IDs
"LucenePHP" AND "LuceneJava") to be shown : but the results show are only
contents having "PHP" / "Lucene" in my custom field.
> >
> > So, I tried many thinks :
> > - indexing as "Text"
> > - queryModel operator "LIKE", then "FULLTEXT ONE OF", ...
> >
> > Nothing I tried could work.

Hum the virtual tree navigation was not designed to work like that (the goal was
precisely to perform branch requests so that in you case both 'lucene'
occurences are considered different properties). Indeed the internal storage of
the category field of your indexed documents will be something like:

  'JAVA/lucene'

or:

  'PHP/lucene'

the Path indexed type is thus not suited to for your usecase since it's
optimized for exact match ('=') on the complete path and STARTSWITH operators
based on the '/' character as path element separator.

You would probably need to use 'Text' type index and ensure that the tokenizer
used by lucene treat the '/' character as a word seperator and then use the
myprefix:myindexedfield = 'lucene' query.

I am not really a lucene / compass specialist so please refer to the their
respective documentation if you need more details on those matters (tokenizer
configuration).

I would also advise you to set your server.log to DEBUG level in
$JBOSS/server/default/conf/log4j.xml and then tail/grep for 'RESOURCE' when
editing / indexing documents and 'SELECT' when performing queries to get a clue
on what's going on.

You should also use the NXQL field of the advanced search form when logged in as
Administrator to be able to debug your NXSQL queries and indexing configuration
before trying to wrapp your queries as querymodels.

Also, the details on how to configure the nuxeo search service and the NXQL
syntax are given in this chapter of the documentation:

  http://doc.nuxeo.org/5.1/books/nuxeo-book/html/search-service.html

--
Olivier

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to