This discussion is archived
6 Replies Latest reply: May 28, 2012 3:33 AM by 760770 RSS

Fuzzy search using GET_SEARCH_RESULTS ?

760770 Newbie
Currently Being Moderated
Is it possible to do a fuzzy search using the GET_SEARCH_RESULTS UCM service call?

If so, how is this done within the existing section of JSTL code?

<wcm:idcService service="GET_SEARCH_RESULTS" var="res">
<wcm:idcParameter name="QueryText" value="${QueryTextVar}"/>
<wcm:idcParameter name="searchFormType" value="queryBuilder"/>
<wcm:idcParameter name="SearchQueryFormat" value="UNIVERSAL"/>
<wcm:idcParameter name="ftx" value="1"/>
<wcm:idcParameter name="ResultCount" value="20"/>

<c:choose>
<c:when test="${param.order_by == 'rank'}">
<wcm:idcParameter name="SortField" value="Score"/>
</c:when>
<c:otherwise>
<wcm:idcParameter name="SortField" value="dInDate"/>
</c:otherwise>
</c:choose>

<wcm:idcParameter name="SortOrder" value="asc"/>

<wcm:idcParameter name="EndRow" value="${param.EndRow}"/>
<wcm:idcParameter name="StartRow" value="${param.StartRow}"/>

</wcm:idcService>
  • 1. Re: Fuzzy search using GET_SEARCH_RESULTS ?
    jiri.machotka Guru
    Currently Being Moderated
    The best info you may get is probably this: http://tech.groups.yahoo.com/group/intradoc_users/message/24873
  • 2. Re: Fuzzy search using GET_SEARCH_RESULTS ?
    William Phelps Expert
    Currently Being Moderated
    There should be another way as well if you understand how your underlying database works.

    Change the line
    <wcm:idcParameter name="SearchQueryFormat" value="UNIVERSAL"/>
    to read
    <wcm:idcParameter name="SearchQueryFormat" value="NATIVE"/>

    and then add one more line
    <wcm:idcParameter name="SearchEngineName" value="DATABASE"/>

    Now you can build out the variable "${QueryTextVar}" to use database-specific operators, such as "dDocName IN ('id1','id2')". Keep in mind that "QueryText" is just a SQL WHERE clause.

    Your mileage may vary.
  • 3. Re: Fuzzy search using GET_SEARCH_RESULTS ?
    760770 Newbie
    Currently Being Moderated
    Hi William

    We changed the line
    <wcm:idcParameter name="SearchQueryFormat" value="UNIVERSAL"/>
    to read
    <wcm:idcParameter name="SearchQueryFormat" value="NATIVE"/>

    and then added one more line
    <wcm:idcParameter name="SearchEngineName" value="DATABASE"/>


    As a test, we then set the query text parameter as follows in order to perform a fuzzy search for the word "claim"
    <c:set var="QueryTextVar" value="CONTAINS(TEXT, 'fuzzy(claim, 70, 7, weight)', 1) > 0"/>


    However, when we tried to run it we got the following error:
    ORA-00904: "TEXT": invalid identifier


    Do you have any ideas of where we have gone wrong please?
  • 4. Re: Fuzzy search using GET_SEARCH_RESULTS ?
    jiri.machotka Guru
    Currently Being Moderated
    You can narrow down your search via server-wide tracing (see here: http://docs.oracle.com/cd/E21764_01/doc.1111/e10792/c02_processes.htm#CSMSP536 )

    Turn on systemdatabase and check what query is sent to the database by UCM. Then, in sqlplus or other console try to find out how the correct query should look like.
  • 5. Re: Fuzzy search using GET_SEARCH_RESULTS ?
    William Phelps Expert
    Currently Being Moderated
    {However, when we tried to run it we got the following error: ORA-00904: "TEXT": invalid identifier{quote}
    The error reported in this particular message in the thread has changed three times. (How about either adding more entries to the thread to report the changes or leaving the other entries intact? It's really hard to diagnose a moving target.)

    "TEXT" (in this incarnation of the error) is not a valid column name in any of the tables defined in the datasource that is used when retrieving search results. The valid columns are those columns found in the tables DOCUMENTS, DOCMETA, and REVISIONS.

    I tried your query locally via the UI, and it doesn't run. I get the same "invalid identifier". I get the same error if I remove the SearchEngineName parameter, so this particular query most likely won't execute. As I stated earlier "you mileage may vary".

    I do get results when I do a search using other stemming techniques, like "?government". What about trying a more backwards compatible approach like this? (Go ahead and remove the entry for "SearchEngineName" from your code, but leave the one for "SearchQueryFormat").
  • 6. Re: Fuzzy search using GET_SEARCH_RESULTS ?
    760770 Newbie
    Currently Being Moderated
    Hi William

    Apologies for previous confusion with the error message changing in the thread.

    I followed your most recent suggestion and managed to get stemmed search working successfully. I guess this is as close as I will be able get to being able to do a "fuzzy" search.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points