Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

SQL Server data source - SearchUnit - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
DMacy
#1 Posted : Wednesday, December 3, 2014 11:00:47 AM
Rank: Advanced Member

Groups: Registered

Joined: 9/1/2010
Posts: 136
I have written a plugin for Search for ASP.NET 2010. I use the Index Manager Tool to Import documents/records and choose FileSystemDocumentStore as the type of source. That part is working fine.

I want to write a new plugin that is totally independent of the first one. This second one needs to get its source entirely from a SQL Server database table. I don't want to have to enter the query in the Index Manager Tool every time I regenerate the index; I'd rather that the query and the weighting of different columns in the table be stored in the plugin.

I don't know how to get started with this new plugin--which events or actions to put my code in. Any help would be greatly appreciated. Thanks!
Jim
#2 Posted : Wednesday, December 3, 2014 1:12:22 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Hi, firstly some things to mention;

- only one plug-in DLL at a time is supported

- if you enter the query in the index manager tool, you shouldn't need to reenter the query again to reimport, you just reimport the existing source (but I understand why you want to do it as a plugin)


There are a couple of ways you can approach this.

1. If you don't mind NOT using the index manager tool, windows service or web admin to do imports then you can index data programmatically. I.e. your own EXE does the indexing.

2. Closer to what you're asking for is "Custom DataSet Provider" (see http://keyoti.com/produc...UserGuide/Importing.htm)
Basically you create an assembly with a class that has a method like public DataSet GetDataSet(int firstRow, int numberOfRows){....} in it. You do an import choosing Custom DataSet Provider, and specify the assembly path and class name (including namespace). The GetDataSet method will be called by the indexer and you can then obtain the data you want to index and return it. It supports paging so that method will be called as many times as necessary.


We don't get asked many questions about #2 so I don't know if our documentation is sufficient or not, just ask if unsure about it please.

Best
Jim

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


DMacy
#3 Posted : Wednesday, December 3, 2014 1:20:05 PM
Rank: Advanced Member

Groups: Registered

Joined: 9/1/2010
Posts: 136
Jim,

Thanks for your prompt reply!

I understand about only one plugin DLL at a time. The two plugins are for two different applications.

Your first approach (creating an EXE to do the indexing) would actually be my preference. Can you point me to documentation that would give me an example of how to get started?

Again, thanks for your help!
Jim
#4 Posted : Wednesday, December 3, 2014 2:11:27 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Sure, http://keyoti.com/produc...ammatic%20Importing.htm

There's 2 ways to do that actually, as an Import, or for total control scroll to the bottom

http://keyoti.com/produc...Importing.htm#preloaded

HTH

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.




About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.