Open topic with navigation
You can use link queries to query for documents based on criteria in the document, and in a connected document. For example, you might want to connect documents written by a particular user with values in the user profile.
To use linked queries, you must configure a
ReferenceMemoryMappedType field that occurs in the documents that you want to query, which contains values that occur in the document references for the connected documents.
ReferenceMemoryMappedType fields provide a fast lookup between child documents and a parent document. For example, for a user profile, this might be a
UserName field in the documents that specifies the user that wrote a document, and the value of that field is the document reference for the user profile.
To use link queries, you must configure a
ReferenceMemoryMappedType field. You then index the documents. You must either ensure that you index the parent documents first (in which the ReferenceMemoryMapped values occur in the document reference), or use the
DREREGENERATE index action to fix the parent-child ordering.
To configure HPE IDOL Server for linked queries
Open the IDX file of the documents that you want to index.
Find the field that you want to use to link documents. This field must contain a value that occurs in a normal field in the documents that you want to search, and in a reference field in the parent documents. For example, it might be a
UserName field in the documents, and the value of this field is the document reference for the user profile.
Open the HPE IDOL Server configuration file in a text editor.
[FieldProcessing] section, go to the end of the list of field processing sections and add the next number. Set this parameter to the name of the field process that you want to create. For example:
[FieldProcessing] ... 10=SetNumericDateFields 11=SetReferenceMemoryMappedFields
Create a section for the field process. Create a property for the process (you define the property later by setting one or more applicable configuration parameters). Identify the fields that you want to associate with the process.
The properties that you create must not have the same name as the processes.
[SetReferenceMemoryMappedFields] Property=ReferenceMemoryMappedFields PropertyFieldCSVs=*/UserName,*/Author
Create a section for the new property, in which you set the
ReferenceMemoryMappedType property to
True. For example:
Save and close the configuration file. Restart HPE IDOL Server for your changes to take effect.
Index the parent documents, and then index the rest of the documents. Alternatively, you can index all the documents and then send a
DREREGENERATE index action to fix the parent-child relationships. For example:
Linked queries rely on the
LINK field specifier, and the
LinkFieldText action parameter. You can use these options in the
To create a linked query, set the following parameters:
||The query text that you want to find in the documents.|
You can also add any other
You cannot use metadata fields in the
Users database has a set of user profile documents that use the user name as the document reference, and list interests and other user information. For example:
<DOCUMENT> <DREREFERENCE>User01</DREREFERENCE> <INTEREST>Soccer</INTEREST> <COUNTRY>USA</COUNTRY> <JOINED>01/01/2012</JOINED> </DOCUMENT> <DOCUMENT> <DREREFERENCE>User02</DREREFERENCE> <INTEREST>Food</INTEREST> <COUNTRY>UK</COUNTRY> <JOINED>02/06/2011</JOINED> </DOCUMENT>
The same index has a
SocialMedia database, which contains posts by these users. For example:
<DOCUMENT> <DREREFERENCE>SM0001</DREREFERENCE> <USERNAME>User01</USERNAME> <DRECONTENT>Just got my tickets for the final in Brazil!</DRECONTENT> </DOCUMENT> <DOCUMENT> <DREREFERENCE>SM0002</DREREFERENCE> <USERNAME>User02</USERNAME> <DRECONTENT>Brazil nuts are so moreish...</DRECONTENT> </DOCUMENT>
The following standard query returns both of these documents:
You can use a linked query to specify additional restrictions. The following query finds posts about Brazil by users who are interested in soccer:
This returns the document
SM0001, but not the document
This query requires the following field configuration:
USERNAME is configured as
INTEREST is configured as