Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how we can extract the most relavent keywords from a document which have high querry value and content value. plz suggest from where i can get its sorce code in asp.net
Posted
Updated 27-Feb-15 6:52am
v2
Comments
PIEBALDconsult 27-Feb-15 13:13pm    
You would have to tell the algorithm which "words" to seek.

1 solution

You can search for a keyword. A keyword is still just a word, that you can search for inside the file (or inside a long string). Then you can simply just get the content of the document, you're having as a string. And perform string functions over it to find your data in it.

For example, if you're going to find an exact match of a word you can write this code,

C#
string data = "This is your data";
string word = "word";

if(data.IndexOf(word) != -1) {
  // The word is found in the string
}


.. or since IndexOf returns an integer value, you can also get the index of this word in the words of string too. Quite multiple other options too, to seach for a word inside a string of data using C# in ASP.NET.
 
Share this answer
 
Comments
PIEBALDconsult 27-Feb-15 13:12pm    
RegularExpression can return multiple Matches -- with position and length.
Afzaal Ahmad Zeeshan 27-Feb-15 13:15pm    
That is also a possible solution, if finding all matches for a keyword. But OP has yet not shown any interest in showing his code at all.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900