I think this limitation stems from element indexes in ML. Would be incredibly useful to specify a path when creating range indexes etc instead of just the element name. Currently I have to duplicate a lot of elements in a separate meta namespace to avoid this problem (which in ML consultant speak is called enrichment!).
Don't suppose there's any plans to support this in the future? Rob -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Palmitesta Sent: 07 November 2008 22:27 To: General Mark Logic Developer Discussion Subject: Re: [MarkLogic Dev General] lib-search faceted search elementhierarchy question. I'm interested in this as well. It feels as though <search:local-name>name</search:local-name> really should be allowed to take an xpath expression. This can't be impossible, from an implementation point of view, since the search-path element can take an xpath: <config xmlns="http://www.marklogic.com/ps/lib/lib-search/config"> <search-path>/path/to/article</search-path> ... </config> We're planning on dealing with this by adding extra per-document meta-data elements in our dataset containing facet-specific information, but honestly, we really should be able to just inspect the stock data with an xpath to indicate what to facet on. Seems like the last lib-search update was in May. Are there any future plans for lib-search? I'm hesitant about delving into and modifying a library if it's being actively developed by the owner of the project, for example. Eric Federico Carbonell wrote: > Currently, I am using lib-search to create faceted search with a XML repository stored in Marklogic. > > The problem I am having is that I am have elements in my documents that have the same label "name", but have different hierarchy. Here is a sample of these elements: > > * For creator name: > > <ddms:creator> > <ddms:Person> > <ddms:name>George Wallace</ddms:name> > <ddms:surname>Wallace</ddms:surname> > <ddms:affiliation>NBCC</ddms:affiliation> > </ddms:Person> > </ddms:creator> > > * For publisher name: > > <ddms:publisher> > <ddms:Organization> > <ddms:name>British Forces Press Service</ddms:name> > </ddms:Organization> > </ddms:publisher> > > * For creator organization name: > > <ddms:creator> > <ddms:Organization> > <ddms:name>Office of the Press Secretary</ddms:name> > </ddms:Organization> > </ddms:creator> > > When I create my facets, my results show that everything that has label "name" belongs to the same results, whether a element "name" result belongs to a child element of "organization" or "person". > > - <search:facets > xmlns:search="http://www.marklogic.com/ps/lib/lib-search"> > - <search:facet> > - <search:facet-def> > - <search:value-facet> > - <search:element id="org-name"> > <search:namespace>http://metadata.dod.mil/mdr/ns/DDMS/1.4/</search:names pace> > <search:local-name>name</search:local-name> > </search:element> > <search:top>50</search:top> > </search:value-facet> > - <search:custom> > <search:sort>name-asc</search:sort> > <search:qs-id>org-name</search:qs-id> > <search:title>Organizations</search:title> > </search:custom> > </search:facet-def> > <search:all count="4" /> > <search:item value="Iraq" count="2">Iraq</search:item> > <search:item value="American Forces Press Service" count="1">American Forces Press Service</search:item> > <search:item value="British Forces Press Service" count="1">British Forces Press Service</search:item> > <search:item value="CNN" count="1">CNN</search:item> > <search:item value="Donna Miles" count="1">Donna Miles</search:item> > <search:item value="FOX" count="1">FOX</search:item> > <search:item value="George Wallace" count="1">George Wallace</search:item> > </search:facet> > - <search:facet> > - <search:facet-def> > - <search:value-facet> > - <search:element id="person-name"> > <search:namespace>http://metadata.dod.mil/mdr/ns/DDMS/1.4/</search:names pace> > <search:local-name>name</search:local-name> > </search:element> > <search:top>10</search:top> > </search:value-facet> > - <search:custom> > <search:sort>name-asc</search:sort> > <search:qs-id>person-name</search:qs-id> > <search:title>Person Name</search:title> > </search:custom> > </search:facet-def> > <search:all count="4" /> > <search:item value="Iraq" count="2">Iraq</search:item> > <search:item value="American Forces Press Service" count="1">American Forces Press Service</search:item> > <search:item value="British Forces Press Service" count="1">British Forces Press Service</search:item> > <search:item value="CNN" count="1">CNN</search:item> > <search:item value="Donna Miles" count="1">Donna Miles</search:item> > <search:item value="FOX" count="1">FOX</search:item> > <search:item value="George Wallace" count="1">George Wallace</search:item> > </search:facet> > - <search:facet> > - <search:facet-def> > - <search:value-facet> > - <search:element-attr id="keyword"> > <search:namespace>http://metadata.dod.mil/mdr/ns/DDMS/1.4/</search:names pace> > <search:local-name>keyword</search:local-name> > <search:attr-local-name>value</search:attr-local-name> > </search:element-attr> > <search:top>10</search:top> > </search:value-facet> > - <search:custom> > <search:sort>name-asc</search:sort> > <search:qs-id>keyword</search:qs-id> > <search:title>Keyword</search:title> > </search:custom> > </search:facet-def> > <search:all count="4" /> > </search:facet> > </search:facets> > > How I can make my search display the correct "name" element results for parent elements "organization" and "person"? > > Here is how I configure my search: > > define variable $LIB-SEARCH-CONFIG as element(cfg:config) { > <config > xmlns="http://www.marklogic.com/ps/lib/lib-search/config" > xmlns:search="http://www.marklogic.com/ps/lib/lib-search" > xmlns:lp="http://www.marklogic.com/ps/lib/lib-parser"> > <search> > <namespaces> > <namespace prefix="ddms">http://metadata.dod.mil/mdr/ns/DDMS/1.4/</namespace> > </namespaces> > <sort-fields> > <sort-field id="ddms:posted" type="xs:date" direction="descending">DOCUMENT/ddms:Resource/ddms:dates/ddms:posted</so rt-field> > <sort-field id="ddms:title" type="xs:string" direction="descending">DOCUMENT/ddms:Resource/ddms:title</sort-field> > <sort-field id="ddms:name" type="xs:string" direction="descending">DOCUMENT/ddms:Resource/ddms:creator/ddms:Organiza tion/name</sort-field> > </sort-fields> > <lp:search-field-map> > <lp:mapping code="title"><ddms:title/></lp:mapping> > <lp:mapping code="date-posted"><ddms:posted/></lp:mapping> > <lp:mapping code="org"><ddms:name/></lp:mapping> > </lp:search-field-map> > <date-field> > <search:element> > <search:namespace>http://metadata.dod.mil/mdr/ns/DDMS/1.4/</search:names pace> > <search:local-name>posted</search:local-name> > </search:element> > </date-field> > <collation>http://marklogic.com/collation/</collation> > </search> > <facets> > <default-do-count>true</default-do-count> > </facets> > <scope> > <search:element id="person-name"> > <search:namespace>http://metadata.dod.mil/mdr/ns/DDMS/1.4/</search:names pace> > <search:local-name>name</search:local-name> > </search:element> > > <search:element id="org-name"> > <search:namespace>http://metadata.dod.mil/mdr/ns/DDMS/1.4/</search:names pace> > <search:local-name>name</search:local-name> > </search:element> > > <search:element id="subjectCoverage"> > <search:namespace>http://metadata.dod.mil/mdr/ns/DDMS/1.4/</search:names pace> > <search:local-name>subjectCoverage</search:local-name> > </search:element> > > <search:element-attr id="category"> > <search:namespace>http://metadata.dod.mil/mdr/ns/DDMS/1.4/</search:names pace> > <search:local-name>category</search:local-name> > <search:attr-local-name>label</search:attr-local-name> > </search:element-attr> > > <search:element-attr id="keyword"> > <search:namespace>http://metadata.dod.mil/mdr/ns/DDMS/1.4/</search:names pace> > <search:local-name>keyword</search:local-name> > <search:attr-local-name>value</search:attr-local-name> > </search:element-attr> > </scope> > <debug>true</debug> > </config> > } > > Thanks. > > Federico Carbonell > Hewlett Packard > [EMAIL PROTECTED] > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
