|
01-07-2004, 08:54 AM | #1 |
Green Mole
Join Date: Jan 2004
Location: Belgium
Posts: 11
|
Search in specific directory
Hello,
I've a problem searching with PhpDig... I'm working on a very big website which is subdivised into 7 departments. Is it possible to limit the search to a single department ? (wich is located in a specific directory) For example : http://www.mywebsite.com/ is the main website the departments are located in : http://www.mywebsite.com/Dep1/ http://www.mywebsite.com/Dep2/ http://www.mywebsite.com/Dep3/ ... and PhpDig is located in : http://www.mywebsite.com/PhpDig/ How to search Dep2 ? Many thanks. Laurent |
01-07-2004, 01:51 PM | #2 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. You can set a robots.txt file with the following content:
Code:
# http://www.mywebsite.com/robots.txt User-agent: PhpDig Disallow: /Dep1 Disallow: /Dep3 Disallow: /Dep4 # and so forth
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
01-07-2004, 06:38 PM | #3 |
Green Mole
Join Date: Jan 2004
Location: Belgium
Posts: 11
|
Ok, but it's not the problem... Sorry but my english isn't very perfect, I'm french-speaking !
Mywebsite is a complete site including all departments. PhpDig must crawl all available departments. But, when a visitor is surfing department 2 and use PhpDig for searching for something, I would like PhpDig return results located only into the department surfed by the visitor (the 2nd in this case). So, for example, if the search query has results in many departments but the visitor is surfing department 2, i'd like to shown results for department 2 only. A solution would be to install PhpDig in each directory, to create databases as much as necessary and to index and crawl each directory (department) separately. But this is a little complicated. Is there another possibility to ask PhpDig returning results in selected directory and not in the full indexed site ? Thanks |
01-08-2004, 01:16 AM | #4 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. Perhaps you could dynamically create the search form and among the input tags of type hidden use the following:
Code:
<input type='hidden' name='site' value='NUMBER'/> <input type='hidden' name='path' value='REL/PATH/'/> <input type='hidden' name='refine' value='1'/>
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
01-08-2004, 02:34 AM | #5 |
Green Mole
Join Date: Jan 2004
Location: Belgium
Posts: 11
|
Hi!
It works perfectly. But we must be carefull, if I want to search the directory and all subdirectories, I must add a "%". So, for example, the code is : Code:
<input type='hidden' name='site' value='1'> <input type='hidden' name='path' value='Dep2/%'> <input type='hidden' name='refine' value='1'> This problem is solved. Thanks a lot ! |
05-05-2004, 10:30 PM | #6 |
Orange Mole
Join Date: May 2004
Location: russia, samara
Posts: 56
|
<input type='hidden' name='path' value='Dep2/%'>
this is dangerous string. What if "hacker" add into this string code: <input type='hidden' name='path' value='Dep2/%"; drop table ha-ha; "'> or something else |
12-08-2004, 01:13 PM | #7 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Update: With PhpDig 1.8.3+ you can crawl within a certain directory if LIMIT_TO_DIRECTORY is set to true in the config file, so only crawl those directories you want to search. Note the comments in the config file when using this option. Also, if you do not want the dropdown on the search menu, then set DISPLAY_DROPDOWN to false in the config file.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
01-04-2005, 09:34 AM | #8 | |
Green Mole
Join Date: Jan 2005
Posts: 1
|
Quote:
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to limit indexing to a specific directory? | Beans | How-to Forum | 1 | 08-15-2005 11:03 AM |
Specific Directory Search | kh44na | How-to Forum | 3 | 04-01-2004 05:52 AM |
Search in specific directory | tams | Troubleshooting | 1 | 03-15-2004 03:08 AM |
exclude specific directory from searching | rasputin | How-to Forum | 1 | 01-29-2004 08:02 PM |
Search in specific directory ONLY? | mrfuches | How-to Forum | 6 | 01-23-2004 12:06 AM |