New Feature: Hold Format Magnify
By Donald Klepack
A new FOCUS hold format command is being added to release 7.7.02 called HOLD FORMAT MAGNIFY. The end result of running a procedure with this command is to make your data immediately available to the Magnify enterprise search tool. This means that right out of the box you can add your data to the Magnify search tool that comes with WebFOCUS with only a limited amount of preparation.
If you have any relational, fix form, free format file, or any data source, you can use a TABLE FILE command and directly produce a Magnify index file. This will be demonstrated using the sample MOVIES file that comes with the installation of WebFOCUS.
Below is the Movies Master File Description:
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, $
By using DEFINE fields and AS statements, we can create FOCUS procedures that contain the six components to do a search:
|
Type |
Alias Name or Prefix |
Purpose |
|
Title |
SearchTitle |
A single field, concatenation of fields or string. |
|
Unique ID |
MagnifyID |
Primary Key field(s) |
|
Categories |
C_ or M_<category> |
Category Field name used in Magnify Category Tree (pre-parsed) |
|
Magnify Attributes |
Magnify Attributes |
Reserved META TAGS names as defined in Magnify Documentation |
|
Other Attributes |
Other Attributes |
Any other field or virtual field |
|
Search Body |
S_<fieldname> |
Concatenation of fields and virtual fields |
The procedure will need to contain the Magnify Engine properties setting that controls how data is fed into the Lucene index.
Magnify the FOCUS Indexing Settings.
|
Property |
Description |
Example |
|
CONNECTION_ATTRIBUTES |
Magnify Indexing Servlet |
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 |
The FOCUS procedure is annotated here:
-**********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
Once the procedure is run, it writes the movies sub-directory containing the index to \ibi\WebFOCUS77\magnify\lucene_index. Also, before you do the search you need to wait based on the timers used for feeding data to the Magnify search. See documentation on Magnify Timers Explained.
Look at Screen 1, produced by entering PG in the search dialog box:

Screen 1
This is just a simple example of what HOLD FORMAT MAGNIFY can do. Please read the documentation for 7702 to learn the full capability for this new feature and how it integrates with the Magnify enterprise search tool.