Ravi
Ravi

Reputation: 1179

Faceting in Marklogic 8

I am looking for some pointers as to how to approach my problem.. I have created a content repository in ML8.0, which has file stored in it. when a file gets uploaded into database, I have custom cpf which creates artifact files (one extracted text, another xml file which is annotations for the input file and one master file (XML) which has references to the raw file uploaded and the extracted and annotated file).
The master file contains other info as well, like the <type/> and <source/> tags. I was able to created a custom search endpoint which when searches will return only the master documents,even if the search hits were in artifact documents.
My dilemma is, I want to add faceting for the <source/> tags and <type/> tags.. and also want to add faceting for some of the tags in annotated documents. so if the search hits both master document and one or more artifact document, the faceting should treat as only 1 hit in the source and corresponding type inside the source tag..
I hope I did not confuse, I am looking for some pointers.. maybe this diagram might help in understanding my problem.. it is a sample , but I have 1000's of documents enter image description here

Upvotes: 1

Views: 77

Answers (2)

grtjn
grtjn

Reputation: 20414

Sounds like you want a facet on <source>, and then for each source facet value a kind of drill down into <type> for that source value. You could use two ordinary facet next to each other, and as soon as you select a specific value from source, the type facet will show the drill down part.

You could also try leveraging tuples on the combination of source and type, but that requires some manual work on server-side and client-side..

HTH!

Upvotes: 1

ehennum
ehennum

Reputation: 7335

I'm not clear on the specifics but, in general, facetting works from indexes, which is necessary for performance at scale.

You should materialize what you want the indexes to reflect directly in the documents that are the targets of search instead of trying to resolve references dynamically for the facets.

That is, as part of your workflow, generate the documents that you want to find and facet. You might also consider creating a different database or using different vocabulary for the workflow documents so you don't need a custom search endpoint to hide them.

Hoping that helps,

Upvotes: 4

Related Questions