Small extra info about searching with wildcards: > Hi Denis,
> > If you want to find documents with a title that contains > "test" but can be "Subject about test documents", you'll have > to configure more: > Index the "title" property as "TEXT" (set that in the indexer [2]). > <property namespace="http://hippo.nl/cms/1.0" name="title" > type="text" > analyzer="org.apache.lucene.analysis.standard.StandardAnalyzer"/> This is not needed anymore since there is the <Spropsearch> which you can use for String indexed properties: we text index them as well since some months (1.2.12 and higher) > > And change your query into: > <d:where> > <d:and> > <d:not-is-collection/> > <S:property-contains> > <d:prop><h:title/></d:prop> > <d:literal>*Test*</d:literal> > </S:property-contains> You never have to prefix and postfix wildcard around a term!! A prefix wildcard will absolutely kill your performance within a couple of hundreds of documents (typically inverted index paradigm), and it will mess up stemming if you would use some language analyzer. So, recapitulating, do not configure the property to be indexed as text, and do a match like: <d:where> <d:eq> <d:prop><h:title/></d:prop> <d:literal>Test</d:literal> </d:eq> </d:where> Or <d:where> <S:propsearch> <d:prop><h:title/></d:prop> <d:literal>Test</d:literal> </d:propsearch> </d:where> Or configure the property to be 'text' indexed, and use <d:where> <S:property-contains> <d:prop><h:title/></d:prop> <d:literal>Test</d:literal> </S:property-contains> </d:where> You cannot use d:eq in the latter case. -Ard > </d:and> > </d:where> > > [1] > http://www.hippocms.org/display/CMS/4.+Hippo+Repository+Config > ure+Extrac > tors > [2] > http://www.hippocms.org/display/CMS/3.+Hippo+Repository+Config > ure+Namesp > aces > > > Regards, > > Jasha Joachimsthal > > www.onehippo.com > Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam > +31(0)20-5224466 San Francisco - Hippo USA Inc. 101 H Street, > suite Q Petaluma CA > 94952-3329 +1 (707) 773-4646 > > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of > > Denis Balog > > Sent: woensdag 4 juni 2008 15:04 > > To: Hippo CMS development public mailinglist > > Subject: [HippoCMS-dev] JSP+dasl+lucene > > > > Hi all, > > > > I'm trying to do some query search > > > > i have folder in repo > > ex. /default.preview/content/jobs/ > > > > there are a lot of xml files that describe some jobs simple example > > ------------------------------------------------------------- > > <?xml version="1.0" encoding="UTF-8" ?> > > <document > > > <meta> > > <id></id> > > <dateCreated>2006-12-06</dateCreated> > > </meta> > > <content> > > <title>Test</title> > > > > </content> > > -------------------------------------------------------------- > > > > I'm trynig to find to get all jobs(xml files) where is title > > (document.content.title) "Test" > > > > is this possible with dasl and lucene > > With this example I'm NOT getting anything > > > > jsp code extract and dasl > > > > ---------------------------------------------------------------- > > <c:set var="dochref" value="content/jobs" scope="request" /> > > <c:import url="dasl_get_resource.jspx" var="dasl" > > scope="page" /> > > <c:forEach > > items="${repository.fetchCollection['/'][dasl][true].documents}" > > var="coll"> > > <p>${coll.content.document.content.title }</p> > > > > ------------------------------------------------------------------- > > <d:searchrequest xmlns:d="DAV:" > > xmlns:slide="http://jakarta.apache.org/slide/" > > xmlns:h="http://hippo.nl/cms/1.0" > > > <d:basicsearch> > > <d:select> > > <d:prop> > > <h:caption/> > > <d:displayname/> > > <h:index/> > > <h:type/> > > <h:publicationDate/> > > <d:modificationdate/> > > <h:title/> > > </d:prop> > > </d:select> > > <d:from> > > <d:scope> > > <d:href>${dochref}</d:href> > > <d:depth>1</d:depth> > > </d:scope> > > </d:from> > > <d:where> > > <d:and> > > <d:contains>"Test"</d:contains> > > <d:not-is-collection/> > > </d:and> > > </d:where> > > <d:orderby> > > <d:order> > > <d:prop><h:index/></d:prop> > > <d:ascending/> > > </d:order> > > </d:orderby> > > </d:basicsearch> > > </d:searchrequest> > > > > > > > > Thanks in advance, > > > > Denis Balog > > > > HintTech > > ******************************************** > > Hippocms-dev: Hippo CMS development public mailinglist > > > ******************************************** > Hippocms-dev: Hippo CMS development public mailinglist > ******************************************** Hippocms-dev: Hippo CMS development public mailinglist
