I've got documents in my MarkLogic datastore that contains address
information in the following format:

<address>
<line>13 Some Street</line>
<line>Some District</line>
<posttown>Sometown</posttown>
<county>SomeCounty</county>
<postcode>SC1 1CS</postcode>
</address>

I want to be able to search across the full address, giving a higher
weighting to results that match in the posttown or county elements. So I've
currently got the following cts:or-query() set up:

cts:or-query ((
cts:element-word-query(xs:QName('line'), $searchstring, ('case-insensitive',
'punctuation-insensitive'), 0.0),
cts:element-word-query(xs:QName('posttown'), $searchstring,
('case-insensitive', 'punctuation-insensitive'), 16.0),
cts:element-word-query(xs:QName('county'), $searchstring,
('case-insensitive', 'punctuation-insensitive'), 6.0),
))

This almost works fine, however I also want the items that contain more
instances of the search string in line, posttown and county to appear higher
in the list of results. Currently if two or more addresses appear in the
same posttown, they get the same score, even if the county or line also
contains the search term for one.

Thanks in advance.
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to