Hi All,
I am using search API and implemented the search:highlight
functionalities. Need some enhancement in my implementation.
Search term is "searchterm1 searchterm2" for the function search:search and
'max-matches' attribute value set to '2', using snippet I transforming the
results.
<html>
<head> searchterm1 ..... some text ..... searchterm1</head>
<body>some text searchterm1 ...........
.....
.....
.....
Searchterm2
</body>
</html>
My requirement is I want to highlight searchterm1 and searchterm2 in the search
results. I am getting search term highlighted for the first two occurrence of
searchterm1, but I want to highlight searchterm2 also. I couldn't increase the
max-matches value, because we couldn't not determine the probability occurrence
of searchterm2. I want to highlight distinct search term. Is there any to
achieve this?
My current output
<search:match path="/*:html/*:body/*:p"
xmlns:search="http://marklogic.com/appservices/search">Text surrounding query
<search:highlight>searchterm1</search:highlight> is highlighted and truncated
<search:highlight> searchterm1</search:highlight>
searchterm2 to configuration.</search:match>
Expected output
<search:match path="/*:html/*:body/*:p"
xmlns:search="http://marklogic.com/appservices/search">Text surrounding query
<search:highlight>terms</search:highlight> is highlighted and truncated terms
<search:highlight>according</search:highlight> to
configuration.</search:match>
Regards,
Sundar
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are
not
to copy, disclose, or distribute this e-mail or its contents to any other
person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has
taken
every reasonable precaution to minimize this risk, but is not liable for any
damage
you may sustain as a result of any virus in this e-mail. You should carry out
your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this
e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general