Hi Emanuele!

I think that the first thing to consider would be how to query such fields.

Then you should study how Linq to Sql mapps such functionality in Sql
Server, since you should work with the same mappings on all rdbms, and
unfortunatly Linq to Sql + Sql Server is our "model".


If SqlServer miss such feature, we should probably choose between:
1) Implementing such feature on SqlServer... OPS: that's closed source! what
a pity! :-)
2) Implementing a DbLinq extension. Such DbLinq extension would not be
accessible on MONO_STRICT compilation.
3) Workaround this.


I suggest for the third.

We could interpret the expression tree differently when the target mapped
column is of this special type, without introducing a new SpecialExpression.

For example String.Contains() could me translated in such a particular sql
when the column has tsvector type, while String.Startwith or EndWith would
raise exception...


Actually this approach would degrade gracefully for those limited closed
source rdbms that do not support the Postgresql best features.


An alternative could be to introduce an extension point on dblinq
ExpressionDispatcher.AnalyzeCall() method: imagine a static dictionary of
static MethodInfo that could be interpreted from programmer defined
delegates... but this could be quite ambitious... and problematic...


Giacomo
PS: I'm not sure, but I guess there are other issue with your question that
Jon and Pascal could tell you. BTW, a new SpecialExpression seem to me quite
wrong...


On Tue, Jul 7, 2009 at 11:43 AM, Emanuele Aina <[email protected]> wrote:

>
> Hi,
>  I'm looking into supporting full text search queries with DBLinq and
> PostgreSQL, and I'd appreciate some directions.
>
> PosgreSQL stores the "hash" of the text that should be matched in
> columns of type 'tsvector', such that searches are quite fast.
>
> http://www.postgresql.org/docs/8.4/static/textsearch.html
>
> For example, you have a table like the following:
>
> table1
> col1:text | col2:tsvector
> ----------|------------------
> foo bar   | tsvector(foo bar)
> bar baz   | tsvector(bar baz)
>
> If you want to search for 'foo' you do this:
>
> SELECT * FROM table1 WHERE col2 @@ 'foo';
>
> I've added an empty TsVector type in the DbLinq.PostgreSql namespace and
> added support for it when generating with DbMetal, such that a simple
> query testing for not-nullness of col2 works.
>
> I'd like to add a TsVector.Matches(string) method that gets converted to
> the '@@' operator, but I need some advice.
>
> I've thought about adding a new SpecialExpressionType but this is quite
> postgres-specific, so I'm not sure if this is the right course of
> action.
>
> Suggestions?
>
> --
> Buongiorno.
> Complimenti per l'ottima scelta.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to