I need to use the new free text search feature.

I understand you must have a full-text enabled DB with a full-text catalog.

I added a [FullText("English")] attribute on a column : a full-text index is then created on this column and I can query it:

Query.FreeText<MyEntity>("test").OrderBy(m => m.Rank)

Ok, now the big question : have you a recommended way to index a big graph of objects?

Let's say I have a complex business object with several EntitySet that may be changed during the life of the object. As I understand I can only create a full-text index on a column containing text. So I guess the correct way is to create a column containing a full-text dump of all the data to index on the root entity, and refresh it asynchronously when necessary.

Is this correct? Is it how you planned this feature to be used?

Other question if I'm right : What's the correct way to detect an entity (or an entity related to this entity) has been changed and change a field (FullTextShouldBeUpdated for instance)? If I can do that, all what's left to do is to walk the graph to build the complete text to index.

This thread was imported from our support forum. The original discussion may contain more detailed answer.

asked Apr 19 '10 at 15:58

olorin's gravatar image

olorin
356838489


One Answer:

> Is this correct? Is it how you planned this feature to be used?

Yes, exactly.

> What's the correct way to detect an entity (or an entity related to this entity) has been changed and change a field (FullTextShouldBeUpdated for instance)?

You can either override protected Entity / Persistent methods (e.g. OnSetFieldValueCompleted), or subscribe to similar Session events.

Note that ideally you must update the combined full-text data once per transaction. This approach is shown in Audit Sample for DO4.

answered Apr 19 '10 at 18:40

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×569

Asked: Apr 19 '10 at 15:58

Seen: 1,953 times

Last updated: Dec 30 '13 at 04:37

powered by OSQA