From: Henning H. <hen...@gm...> - 2011-07-18 13:35:20
|
Hello team, I have the same problem by trying just the example of Ron's blog: http://rvdb.wordpress.com/2010/10/06/mimicking-faceted-searching-in-exist/with the eXist release candidate of 1.4.1. I did the exact same as the blog explained - but the result of the local:term-callback is still missing! So I gad the following result: <results> <speakers/> <hits> <SPEECH> <SPEAKER>PARIS</SPEAKER> <LINE>Of honourable reckoning are you both;</LINE> <LINE>And pity 'tis you lived at odds so long.</LINE> <LINE>But now, my lord, what say you to my suit?</LINE> </SPEECH> <SPEECH> ... </SPEECH> </hits> </results> 2011/7/17 Joe Wicentowski <jo...@gm...> > Marjorie, > > Could case be a factor? ft:query using Lucene's query syntax is case > insensitive, but util:index-keys is case sensitive (as I recall). Do > you have $hits containing words that begin with lower-case 'a'? > > Failing that, Peter's right - you may benefit from bugs fixed since > 1.4.0 (20091111) by using a release candidate of 1.4.1. See the > download link at http://atomic.exist-db.org/blogs/eXist/. > > Joe > > > On Sun, Jul 17, 2011 at 3:34 PM, Marjorie Burghart > <mar...@eh...> wrote: > > @Peter: hmm, that's interesting... I tried changing the analyzer for the > > standard one, but it still does not have the expected behaviour. I get an > > empry result: > > > > <div id="facet"/> > > > > I guess there's something wrong with the local:facet and / or the > > local:term-callback functions, because the search for "a*" itself > retrieves > > the right results... > > > > @Joe: thanks, but I don't think it's an ns problem, the queries work fine > > until I get into the index-keys part... > > > > > > If anybody had a working xquery snippet that they could share, listing > > alphabetically the index keys for a particular collection, I'd be most > > grateful! > > > > All the best, Marjorie > > > > > > > > > > > > Le 17/07/2011 20:46, Peter Stadler a écrit : > > > > Ok, I tried your example and it didn't work for either -- with the > > whitespace analyzer. > > Using the standard analyzer it did work. > > > > I'm on 1.4.x rev 13754 and tried with my data but maybe that could be > your > > remedy as well? > > > > Hope it helps > > Peter > > > > Am 17.07.2011 um 20:30 schrieb Marjorie Burghart: > > > > I've added the declaration, and now I din' get any result - there's no > > error, but in the sandbox there's just "Query sent..." indefinitely. > > I should add that the lucene index on "body" works fine when I query it. > > > > All the best, > > Marjorie > > > > Le 17/07/2011 20:09, Peter Stadler a écrit : > > > > You'll propably have to declare the TEI namespace -- both in > > collection.xconf and in the query?! > > > > All the best > > Peter > > > > Am 17.07.2011 um 19:49 schrieb Marjorie Burghart > > <mar...@eh...>: > > > > Tank you Peter! > > I've tried that, but I don't get any result, and I'm not sure whether > it's > > because my query is wrong or because there's still a bug > > > > > > > > > > declare function local:term-callback($term as xs:string, $data as > xs:int+) > > as element() { > > <entry> > > <term>{$term}</term> > > <frequency>{$data[1]}</frequency> > > <documents>{$data[2]}</documents> > > <position>{$data[3]}</position> > > </entry> > > }; > > declare function local:facets($hits as element()*) { > > <div id="facet"> > > {util:index-keys($hits, 'a', > > util:function(xs:QName("local:term-callback"), 2), 1000)} > > </div> > > }; > > let $hits := collection('/db/books')//body[ft:query(.,'a*')] > > return local:facets($hits) > > > > > > > > > > In the application.xconf for the /db/books collection, I have this index > > definition: > > > > <lucene> > > <analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/> > > <analyzer id="ws" class="org.apache.lucene.analysis.WhitespaceAnalyzer"/> > > <text qname="body" analyzer="ws"/> > > <inline qname="ex"/> > > <inline qname="lb"/> > > <inline qname="pb"/> > > <ignore qname="rdg"/> > > <ignore qname="note"/> > > </lucene> > > > > > > > > When I execute the query above in the sandbox, there's no error but I get > 0 > > result. > > I'm using eXist 1.4.0, SVN Revision: 10440, Build: 20091111. > > > > All the best, Marjorie > > > > > > > > > > Le 17/07/2011 13:52, Peter Stadler a écrit : > > > > Marjorie, > > > > maybe until:index-keys() will do what you are looking for? > > A good example on how to use is Ron's blog: > > > http://rvdb.wordpress.com/2010/10/06/mimicking-faceted-searching-in-exist/ > > > > > > Sadly, there's still an open ticket for util:index-keys and the lucene > index > > but I don't know if it's still valid? (see > > > http://sourceforge.net/tracker/index.php?func=detail&aid=3136591&group_id=17691&atid=117691 > > ) > > > > Secondly, depending on your lucene analyzer there could be some > lemmatizing > > (and stop words) involved: if you are interested in "words" that'd be > great, > > if you are interested in "strings" it wouldn't. > > > > All the best > > Peter > > > > > > Am 17.07.2011 um 06:44 schrieb Marjorie Burghart: > > > > > > Hi all! > > I'm using a eXist with PHP, and I would like to migrate an ols XSP > > application. > > > > So far it has worked like a charm, at the exception of a feature that > > I'm not sure how to migrate - if possible: I need to provide a list of > > all the words used in a collection (which boils down to listing all the > > terms of the full-text lucene index). > > > > Is it possible to do that with an Xquery in eXist? > > > > Many thanks in advance for your help! > > Marjorie > > > > > > > > -- > > Marjorie BURGHART > > EHESS (pôle de Lyon) / UMR 5648 > > Histoire et Archéologie des Mondes Chrétiens et Musulmans Médiévaux > > 18 quai Claude Bernard > > 69007 Lyon - FRANCE > > > > > ------------------------------------------------------------------------------ > > AppSumo Presents a FREE Video for the SourceForge Community by Eric > > Ries, the creator of the Lean Startup Methodology on "Lean Startup > > Secrets Revealed." This video shows you how to validate your ideas, > > optimize your ideas and identify your business strategy. > > http://p.sf.net/sfu/appsumosfdev2dev > > _______________________________________________ > > Exist-open mailing list > > Exi...@li... > > https://lists.sourceforge.net/lists/listinfo/exist-open > > > > > > > ------------------------------------------------------------------------------ > AppSumo Presents a FREE Video for the SourceForge Community by Eric > Ries, the creator of the Lean Startup Methodology on "Lean Startup > Secrets Revealed." This video shows you how to validate your ideas, > optimize your ideas and identify your business strategy. > http://p.sf.net/sfu/appsumosfdev2dev > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > |