Thanks , John , you misunderstand me .
What i want is to get the pure-text about 20 bytes near th
the searching words , it looks like :
When i search 'full-text' in one doc: "sql server full-
text searching reference, ..." , i also want to get the
text 'full-text searching reference,...' and so on.
like google , When you search something , you can get some
hints texts containing the searching words !
So , maybe MSSearch will return the offset of the doc ,
then reading 20 bytes beside the offset , using IFilter to
translate the bytes into text!
Just one idea , and i don't know how to implement !
thanks ~
>-----Original Message-----
>Rainbow,
[quoted text clipped - 22 lines]
>Thanks,
>John
John Kane - 28 Oct 2004 08:00 GMT
You're welcome, Rainbow,
That is why I asked the questions, to get more information and a better
clarification on what you are really after!
While not exactly what Google provides (or even the Indexing Services'
abstract/characterization), the following is as close as you can get using
T-SQL and SQL Server 2000 Full-text Search (FTS):
-- The following SQL FTS query on the pubs table pub_info will return rows
that match the FTS search word (books) and return test that is near the
search word from 20 characters before the search keyword (books) for a total
length of 100 characters.
use pubs
SELECT pub_id, SubString(pr_info,PatIndex ('%books%',pr_info)-20,100)
FROM pub_info
WHERE Contains(pr_info, 'books')
You can vary the patindex parameters (20 & 100 in the above query) to expand
or contract the amount of text that will be displayed. However, the MSSearch
does not provide any direct method of returning an offset of the word in the
row/document, nor do the various IFilters provide an means of translating
the bytes into text. In order to get this level of granularity, you would
have to write your own IFilter for types of document you would want store
and search in order to get the information you are looking for and this is a
non-trivial effort...
This is not an un-common request, given the impact that Google has had in
Full Text Search over the last couple of years, but alas this type of
feature is not available in SQL Server 2000....
Let me know if this comes closer to what you're interested in doing!
Thanks,
John
> Thanks , John , you misunderstand me .
>
[quoted text clipped - 49 lines]
> >Thanks,
> >John