Free Support Forum - groupdocs.com

Select an index to perform search using C# .NET

HI I need support for search functionality.

When i upload a file into storageFolder under projectId(1) i’m creating an index for that storageFolder documents.
C:\1\storageFolder - Documents will be there
C:\1\DocumentIndex - index folder

Likewise i will have documentstorage structure for different projects
C:\2\storageFolder
C:\2\DocumentIndex - index folder
The Above process happening while uploading a document into storage.

now Assume i have existing index for project1 and project2.

So from SearchUI Page ,
Step-1 i will select ProjectId(for example 1)
Step -2 search text typed and click search button,

need to refer already created index(project1) and search need to perform without creating an new instances for index.

i already referred example projects.that didn’t help me out.

@bharathiGK

What we extracted from your scenario is, you will create multiple projects with unique IDs (from multiple projects you mean multiple file and indexing storage/instances). Each project will have a storage and a index folder.
You want to have a control prior to perform search operation. A control to specify project ID and get results only from that project.
If this is what you are looking for, you can do it at code level.You can specify the Index where you want to perform search. For example,

Project 1:

Index index1 = new Index(indexFolder1);
index.Add(documentsFolder1);

Project 2:

Index index2 = new Index(indexFolder2);
index.Add(documentsFolder2);

In your application you can count the Index objects, then show count in the UI and ask, in what object you want to perform search. Suppose you want to perform search over index2 and you select it from UI,

SearchResult result = index2.Search("answer");

Otherwise, please further elaborate your use-case.