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
The dictionnaries are built using the following csv files :
Categories :
id, label, obsolete
"Java","Java","0"
"PHP","PHP","0"
Subcategories :
id, label, parent, obsolete
"Nuxeo","Nuxeo","Java","0"
"LuceneJava","Lucene","Java","0"
"LucenePHP","Lucene","PHP","0"
"pear","Pear","PHP","0"
First try, I just make things as they are done for "subjects (topics /
subtopics)" :
- indexing my field as "Path"
- queryModel with operator "STARTSWITH"
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.
-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Olivier Grisel
Envoyé : lundi 15 septembre 2008 15:56
À : [email protected]
Objet : Re: [Ecm] Plugin VirtualNavigation : which query is processed ?
Romain Delalande a écrit :
> I could surely find the contribution and then, the queryModel.
> It is like :
>
> <queryModel name="byCoverageNavQueryModel" docType="QueryNav">
> <max>10</max>
> <whereClause>
>
> <predicate parameter="dc:coverage" operator="STARTSWITH">
> <field schema="querynav" name="coverage" />
> </predicate>
>
> </whereClause>
>
> <sortColumn>
> <field schema="advanced_search" name="sortColumn" />
> </sortColumn>
>
> <sortAscending>
> <field schema="advanced_search" name="sortAscending" />
> </sortAscending>
>
> </queryModel>
>
> But it is just not enough for me.
> I can change the operator, trying "STARTSWITH", "LIKE", or even "=", but the
> result is not satisfying.
STARTSWITH is what you want if the field of the document is indexed with type
'Path' in your nxsearch-contrib.xml file.
> To be precise, the fact is that I have a two-level dictionnary
> Category/subcategory, similarly to "Subjects (topics / subtopics)". A
> document can have several values of subcategories, just as a core document
> can have several subtopics : Art/painting, Art/literature ...
>
> The specific point is that, in my plugin, some different categories can have
> the same subcategory.
If you want to query on a custom field, i.e. one that is not defined in
dublincore.xsd but instead in your custom schema then your should contribute a
new definition to the DirectoryTreeManager extension point to use your custom
vocabulary to build a tree able to use the custom query model of yours.
--
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