From: Wolfgang M. <wol...@ex...> - 2011-11-20 14:40:37
|
It's hard to say where the bottleneck is in your query. I would try to test the different parts of the query individually to see where it gets slow. Some hints: > let $results := > /i:DDIInstance/su:StudyUnit/@id[ft:query(., $search-string)] > | > /i:DDIInstance/su:StudyUnit/r:Citation/r:Creator[ft:query(., > $search-string)] | > /i:DDIInstance/su:StudyUnit/r:Citation/r:Title[ft:query(., > $search-string)] | You are using long paths here and I wonder if you really need to. Can't you replace the above by a simple //r:Title[ft:query(., $search-string)]? If you need to make sure it's indeed a child of r:Citation, use a parent step afterwards: //r:Title[...]/parent::r:Citation. Also, instead of indexing and querying each of those fields individually, it may be an option to just create a single (!) lucene index on /i:DDIInstance and filter out false matches afterwards? Somehow I think you are stressing the lucene index too much with all those different fields and boosts. Anyway, I would first try to benchmark those expressions individually to see where the problem is. I guess we can come up with a faster variant if we know the bottleneck. Wolfgang |