agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
Text searching HTML
2+ messages / 2 participants
[nested] [flat]

* Text searching HTML
@ 2014-11-03 17:15  Campbell, Lance <lance@illinois.edu>
  0 siblings, 1 reply; 2+ messages in thread

From: Campbell, Lance @ 2014-11-03 17:15 UTC (permalink / raw)
  To: pgsql-sql

PostgreSQL 9.3
Is there a preferred way to search text within an HTML document?  I have been reading up on searching via to_tsvector.  You can pass the to_tsvector two parameters.  The first appears to be a dictionary and the second text.  Is there by chance an English HTML dictionary?  That way html tags or html attributes would be ignored.

If not then what would be the suggested dictionary?  Simple or English or something else.

Thanks for your assistance.


Thanks,

Lance Campbell<http://illinois.edu/person/lance;
Software Architect
Web Services at Public Affairs
217-333-0382
[University of Illinois at Urbana-Champaign logo]<http://illinois.edu/;

Attachments:

  [image/png] image001.png (1.4K, ../../B75CD08C73BD3543B97E4EF3964B7D701FC741C9@CITESMBX1.ad.uillinois.edu/3-image001.png)
  download | view image

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Text searching HTML
@ 2014-11-03 20:09  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Campbell, Lance <lance@illinois.edu>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2014-11-03 20:09 UTC (permalink / raw)
  To: Campbell, Lance <lance@illinois.edu>; +Cc: pgsql-sql

"Campbell, Lance" <lance@illinois.edu> writes:
> Is there a preferred way to search text within an HTML document?  I have been reading up on searching via to_tsvector.  You can pass the to_tsvector two parameters.  The first appears to be a dictionary and the second text.  Is there by chance an English HTML dictionary?  That way html tags or html attributes would be ignored.

I believe all the built-in text search configurations ignore HTML tags by
default, since they have no mapping for the "tag" token type that the
built-in parser reports those as.  You could of course make a custom
configuration that acts differently.

			regards, tom lane


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2014-11-03 20:09 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-11-03 17:15 Text searching HTML Campbell, Lance <lance@illinois.edu>
2014-11-03 20:09 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox