FieldFullTextSearchPredicate For Oracle

Posts   
 
    
saravana
User
Posts: 63
Joined: 11-Nov-2010
# Posted on: 05-Sep-2012 15:04:39   

Hi,

I need to implement Full-text search and Exists Node search (both on multiple fields) with my oracle database. We are currently using LinqMetaData class and custom function mapping implementation for these purposes.

But due to issues in adding Dynamic filters & Predicate expressions in the LINQMetadata (is this possible in the LINQ implemetation?), we use multiple methods (separate methods for Full-text search and exists node search) now. To aviod that I want to use normal way of building dynamic list and add multiple condtions (Full-text search and exists node search ,attribute search and field value search) to where clause.

I have seen the following saying that we can modifiy the FieldFullTextSearchPredicate for Oracle. Could you specify where exactly I have to make the changes? so that I can use the approach of dynamic list + full-text and xml node search in one method call?

http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=16456&HighLight=1

Also could you specify whether we can use the CustomFunction mappings in the Dynamic List approach? I am using V3.1 now. is there any of this feature is available in 3.5.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 05-Sep-2012 20:22:46   

Not sure if you want to use Linq2LLBLGen or the Low Level LLBLGen APIs.

saravana
User
Posts: 63
Joined: 11-Nov-2010
# Posted on: 13-Sep-2012 14:50:51   

I want to use it in Low lever LLBLGen API.

I have copied the code from FieldFullTextSearchPredicate and create my own class in BL called "OracleFullTextSearchPredicate". I have just chaged the ToQueryText() method in that class to output the contains search with oracle syntax (added "> 0").

I could not do the same for the existsNode function as I am not sure which class from LLBLGen to extend or where the "ExistNode" operator is available?

Also I want to added the ExistNode condition in the where clause. So I could not able to use the DBFunctionCall() expression for this purpose.

I can able to form the IExpression for ExistsNode search as below.


IExpression existsNodeExression = new DbFunctionCall("existsNode({0},{1}) > 0",
                              new object[] {documentFields.Content, existsNodeString });

But I could not apply this expression to any where clause predicate. Could you give me an idea of how to do this?

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 13-Sep-2012 19:24:07   
SELECT warehouse_id, warehouse_name
   FROM warehouses
   WHERE EXISTSNODE(warehouse_spec, '/Warehouse/Docks') = 1;

This is a DBFunctionCall indeed, but should be implemented as follows:

IExpression existsNodeExression = new DbFunctionCall("existsNode({0},{1})",
                             new object[] {documentFields.Content, existsNodeString });

Hint: Remove the operator and the left hand side.

Then this expression can be set to an entityField (any entityField), and used in a FieldCompareValuePredicate expression

Something like:

var field = documentFields.Id;
field.ExpressionToApply = existsNodeExression;

predicate.Add(field > 0);