Reference: |
The FORMAT MAGNIFY command enables WebFOCUS developers to easily transform raw data into search results by generating an indexable document with Magnify. Developers can create report procedures that define all of the necessary search properties to generate an index. The fields in the Master Files are aggregated together to form searchable content as well as categorizations while possibly combining multiple rows into single row search result documents. The following is a sample MOVIES Master File that contains several field names, which can be used to index the MOVIES data. The movies.mas master file is located in the \ibi\apps\ibisamp directory of your WebFOCUS Reporting Server installation.
FILENAME=MOVIES,SUFFIX=FOC SEGNAME=MOVINFO,SEGTYPE=S1 FIELDNAME=MOVIECODE, ALIAS=MCOD,FORMAT=A6, INDEX=I, $ FIELDNAME=TITLE, ALIAS=MTL,FORMAT=A39, $ FIELDNAME=CATEGORY, ALIAS=CLASS,FORMAT=A8, $ FIELDNAME=DIRECTOR, ALIAS=DIR,FORMAT=A17, $ FIELDNAME=RATING, ALIAS=RTG,FORMAT=A4, $ FIELDNAME=RELDATE, ALIAS=RDAT,FORMAT=YMD, $ FIELDNAME=WHOLESALEPR, ALIAS=WPRC,FORMAT=F6.2, $ FIELDNAME=LISTPR, ALIAS=LPRC,FORMAT=F6.2, $ FIELDNAME=COPIES,ALIAS=NOC, FORMAT=I3, $
WebFOCUS developers can use DEFINE fields and AS statements in the report procedure to define the following search components required for each indexed document:
Type |
Alias Name or Prefix |
Description |
---|---|---|
Title |
SearchTitle |
A single field, or a concatenation of fields or string. This can include a concatenation of static strings and various columns. The name is case-sensitive and is assigned to the TITLE meta tag. |
Unique ID |
MagnifyID |
Primary Key field(s). Unique IDs are unique within each Library Index directory. |
Categories |
C_ or M_<category> |
Category Field name used in the Dynamic Categorization Tree (pre-parsed).There is no limit to the number of fields designated for Categories. Category Fields are mapped in the order they appear. Use underscores to include spaces in the C_ or M_ names. C_ and M_ are converted to the FX values as part of the feed document output. The C#_ and M#_ prefixes can be used to set the order of the categories in the Dynamic Categorization Tree. Note: When using the M# prefix, add A to accumulate all values found at the lowest-level BY statement. The C_ prefix is converted to the FXV meta tag. The M_ prefix converts to the FXM meta tag in the URL of the record. |
Magnify Attributes |
Magnify Attributes |
Reserved META tag names, which are case sensitive. For more information on the available Meta tags, see Creating the HTML Document. |
Other Attributes |
Other Attributes |
Any other field or virtual field. All other fields are added as meta tags based on the Field or Alias name and their respective value. |
Search Body |
S_<fieldname> |
Concatenation of fields and virtual fields. The S_ prefix maps to the BODY meta tag in the document and the IBI_CONTENT field in the index library. Fields can be of any data type. The TX fields must be the last field in a PRINT statement. Search fields can be accumulated by prefixing them with SA_. Any field of any data type can be assigned the S_ or SA_ prefix. |
The procedure must also define the following required Magnify search engine properties, which control the feed process:
Property |
Description |
Example |
---|---|---|
CONNECTION _ATTRIBUTES
|
Magnify Indexing Servlet. The ENGINE SET Statements can be overridden on a record by record basis by using the MagnifyBaseURL, MagnifyMime, MagnifyAction, and MagnifyDatasource values. |
http://localhost:8080/ibi_apps/xmlfeedtest |
BASEURL |
WebFOCUS Report base url. |
http://localhost:8080/ibi_apps/WFServlet |
MIME |
Document mime type. |
text/plain |
DATASOURCE |
Magnify index library directory. |
Movies |
DELIMITER |
Separator for multiple categorizations. |
#!# |
BATCHSIZE |
Number of records to burst at a time. |
100 |
Note: If the data contains non-ASCII characters, UTF-8 encoding is required and the WebFOCUS Reporting Server must be set to NLS UTF-8.
The following is a report procedure that defines the required search properties used to create an index using the MOVIES data. The carmgn.fex and moviesmgn.fex sample procedures are included in the ibisamp directory of the WebFOCUS Reporting Server installation.
-**********Engine settings ENGINE MAGNIFY SET CONNECTION_ATTRIBUTES MY_PC 'http://localhost:8080/ibi_apps/xmlfeed' ENGINE MAGNIFY SET BaseURL=http://localhost:8080/ibi_apps/WFServlet ENGINE MAGNIFY SET MIME=text/plain ENGINE MAGNIFY SET DATASOURCE=movies ENGINE MAGNIFY SET DELIMITER=#!# ENGINE MAGNIFY SET BATCHSIZE=2 -****** required SET command SET ASNAMES=MIXED -****** Application Path APP HOLD test DEFINE FILE MOVIES OLD_DATE/I8YYMD= 20100915; NEW_DATE/YYMD = OLD_DATE; -****** MagnifyAction/A10 = 'add'; SEARCHBODY/TX50=TITLE|CATEGORY|DIRECTOR|RATING; END
TABLE FILE MOVIES PRINT TITLE AS 'SearchTitle' -* Magnify Attribute MOVIECODE AS 'MagnifyID' MOVIECODE AS 'WF_INDEX_UNIQUE_KEY' -* category variable start with C_ CATEGORY AS 'C_CATEGORY' DIRECTOR AS 'C_DIRECTOR' RATING MagnifyAction -* search variables start with S_ TITLE AS 'S_Title' CATEGORY AS 'S_CATEGORY' DIRECTOR AS 'S_DIRECTOR' RELDATE AS 'S_RELDATE' OLD_DATE AS 'S_OLD_DATE' NEW_DATE AS 'S_NEW_DATE' SEARCHBODY AS 'S_SearchBody' ON TABLE HOLD FORMAT MAGNIFY AS MAGN_MOVIES_BATCH END
When the report procedure is executed, the index is generated and the data from the Movie database is available for searching.
WebFOCUS |