How to search data in my own module(News module) with Orchard.Search module?

Topics: Administration, Core, General
Jan 18, 2012 at 5:37 AM


I created my own News module and added Orchard.Search module.When doing search, not sought in the my module News.How I must save the news in the database so that they appear in the search?

Jan 18, 2012 at 5:47 AM

Enable search indexing on that content type, it's an option in the content type editor.

Jun 1, 2012 at 6:39 AM

I want to have a social network built under orchard, and want users to be searchable. I added them to index yet the search would not search them. any Idea ? I am more concerned about custom content parts I have added under user, ie. a Profile Picture, Location etc.

Jun 1, 2012 at 9:27 AM

You should make a) the content type b) all the parts' properties and fields included in the index. The default User content type has nothing searchable if I remember correctly. You could make e.g. usernames searchable from a migration (search the solution for Indexable() for examples), but then you should make the User content type indexed (this is only possible from the admin UI if you created the User content type from a migration; the Profile module does this) and also check the username to be indexed from the Search settings. Also you won't see the difference instantly, as indexing is run periodically, but you can invoke the rebuild of the index from there too.