Concatenate multiple fields into a single field in marklogic -
these sample xmls i'm uploading database:
<?xml version="1.0" encoding="utf-8"?> <axfroot> <maobject type="default" mdclass="news_video" label="news video"> <id name="">123456</id> <meta name="maintitle" format="string" label="title">clifford irving hugs wife edith after release nassau jail.</meta> <meta name="system_objectowner" format="string" label="owner">default</meta> <meta name="keywords" format="string" label="keywords">clifford-irving edith-irving prisoner-releases 1972-08-18 nassau new-york nassau-county-jails prisons wifes husbands media, [],</meta> </maobject> <axfroot> <?xml version="1.0" encoding="utf-8"?> <axfroot> <maobject type="default" mdclass="news_video" label="news video"> <id name="">456123</id> <meta name="maintitle" format="string" label="title">camel news caravan- segment 2: military women march in formosa in 1950.</meta> <meta name="system_objectowner" format="string" label="owner">default</meta> <meta name="keywords" format="string" label="keywords">military women-march formosa-in-1950 united-states-army us</meta> </maobject> <axfroot> <?xml version="1.0" encoding="utf-8"?> <axfroot> <maobject type="default" mdclass="news_video" label="news video"> <id name="">78946</id> <meta name="maintitle" format="string" label="title">commercial title</meta> <meta name="system_objectowner" format="string" label="owner">default</meta> <meta name="keywords" format="string" label="keywords">commercial 2009 english advertisement movie parts</meta> </maobject> <axfroot>
what want here that, when search word /search?q=us, want query result have data field in json contains places has word us.
eg : data :{clifford-irving edith-irving prisoner-releases 1972-08-18 nassau new-york nassau-county-jails prisons wifes husbands media, [],camel news caravan- segment 2: military women march in formosa in 1950.military women-march formosa-in-1950 united-states-army commercial title}
is there way of doing such queries in marklogic?
using search api, can xml structure snippet showing each match in context.
you might need specify large max-snippet-chars value make sure entire snippet text:
anyway, can transform xml structure json object. instance, using rest api, can specify post-processing transform search:
by way, xml vocabulary appears provide markup semantics via attribute values (especially name attribute). able index , restrict search matches based on markup semantics, should consider changing model values markup, in maintitle element , objectowner element. generic markup meta element not useful index.
hoping helps,
Comments
Post a Comment