PDA

View Full Version : Searching only content from one domain in database


jasonm0928
03-18-2004, 09:58 AM
First off this seems to be a great program. Thanks for writing and maintaining it...

I have a problem that I just can't figure it out. Maybe I'm being thick, I don't know.... Anyway, I'm trying to only search through the content of one site as opposed to all sites in the database. I thought that the site variable was what I needed to change to the site_id but that doesn't appear to be working. Could you help point me in the right direction of what I need to do in order to do this? Thanks much....


P.S. I'm useing version 1.8.0

vinyl-junkie
03-19-2004, 04:29 AM
First of all, welcome to the forum, jasonm0928. We're glad to have you here!

I'm not sure just what kind of search you're asking to do. Is it a subdomain? Everything in a sub-folder? Something else?

Don't know if this will help or not, but if you want to exclude particular links from being indexed, you can include the following comments on their own line above and below the links you want to exclude:
<!-- phpdigExclude -->
your link(s) to exclude go here
<!-- phpdigInclude -->
If I'm misunderstanding your problem, please elaborate a little further. Thanks.

jasonm0928
03-19-2004, 09:37 AM
Thanks for the warm welcome, I appreciate that...

What I'm trying to do is for example in my database I have 3 urls indexed. For examples sake lets say www.yahoo.com, www.google.com, www.debian.org. I want to be able to restrict a search based on only one url. So I would like to be able to have a search for only www.debian.org and it would not try to find links from the other two domains....

vinyl-junkie
03-19-2004, 06:51 PM
Start reading through this thread (http://www.phpdig.net/showthread.php?s=&threadid=411&highlight=limit+search), and follow the link to the second thread within it. Between the two, there should be some ideas to help you solve your problem.

Hope this helps! :)

jasonm0928
03-20-2004, 03:18 AM
Hurmmm, that is exactly how I have been trying to do it. It seems that it doesn't care what value I have as the "site" variable at all. This is why I'm totally confused. I am thinking the site variable should be the site_id value from the database. I guess I will keep playing with it and see what I'm doing wrong... Thank you very much for your help.

sanford
03-20-2004, 05:11 AM
Jason,

I think you also need to set refine = 1

Sanford

vinyl-junkie
03-20-2004, 05:51 AM
Let us know whether or not that last suggestion helped. This type of question seems to come up fairly often in the forum, and since it's something I could very well want to use someday myself, I'll be interested in how you solve it. Thanks.

jasonm0928
03-20-2004, 07:13 AM
Hurmmm, This is very very interesting.... I had been doing the refine=1 and it wasn't working although now it is. This is breaking my brain. I don't know what I am doing different now or what exactly I changed but now everything is working like I expected it to originally. One thing I have changed today is I setup the Admin panel v1.0 mod today. Not for sure if that had anything to do with it or not. I couldn't believe it would although it did overwrite the original search.php file.

jasonm0928
03-20-2004, 07:18 AM
No, actually I replaced the original search.php file and it is still working. Very very odd. I really have no darn clue why it started working out of the blue like that. I'm sure there is more than meets the eye. Probably an error on my part but for the life of me I can't think of what I changed that made it start working correctly.

lighthouse
03-22-2004, 06:36 AM
I knocked up this little bit of code that can be easily modified to suit.....

----------snip------------
<form action='search.php' method='get'>

<input type='hidden' name='site' value='11'/>
<input type='hidden' name='path' value=''/>
<input type='hidden' name='result_page' value='search.php'/>

<span class="maintext"><b>Search Our Network of sites:</b>
<br /><br />

Search: <input type='text' class='pagesearch' size='15' maxlength='50' name='query_string' value=''/>


<select name='option' class='pagesearch'>
<option value="start" selected >all words</option>
<option value="exact" >exact phrase</option>
<option value="any" >any words</option>
</select>

in

<select name='refine' class='pagesearch'>
<option value="1" >Particular Domain</option>
<option value="0" selected >Entire Network of sites</option>
</select>

<input type='submit' class='pagesearch' name='search' value='Go'/>

</form>
------------------------------


Hope this helps.... works really well for our purposes

Gary