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 that can be used to index the MOVIES data:
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, $
The following is a report procedure that defines the required search properties used to create an index using the MOVIES data. The syntax for this sample report procedure is located in ibi\apps\ibisamp\moviesmgn.fex.
-**********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 Movies database is available for searching:
For more information on indexing using the FORMAT MAGNIFY command, see the Magnify Developer's Guide.
WebFOCUS |