Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm coding a Linux/PHP site for an organization. The site has two views, activated by a login $_SESSION variable indicating whether one is logged in as a member or not. I need to provide search functionality for both the public and for members. The members area is private. Note that Google Custom Search can't be used here in that case.

Does anyone have any recommendations on F/OSS scripts (or perhaps cheap scripts I can purchase) that would provide this functionality with two separate indices, one public and one private, and which would provide paginated results and a keyword search form?

Otherwise, I guess I'll have to code one myself. I'm trying to save time, and therefore keep more money in my pocket.

P.S.

Note I can't ask this on StackOverflow because they want programmer questions there. This isn't a "how do I code this?" question, but "what F/OSS scripts or cheap sitescripts would solve this problem?" type of question.

Note also that this won't help me either. I mean, look at the answers of that question.

share|improve this question
    
I want to remain PHP. I may have to go custom. I'm thinking of using 'wget' to download the content, and use a secret ?member= code to activate being a member, so that I can get that content too. From the two folders of content, I can write a script to index this into SQLite. I can divide each page up into 3 parts, storing keywords for each, and this can help with relevancy algorithms with SELECT UNION. –  Volomike May 23 '11 at 8:16

1 Answer 1

I've enjoyed using ElasticSearch, a Lucene-based, RESTful, schemaless JSON document search engine. While it is Java based, the simple RESTful interface is a breeze to use in PHP, and there's even a library to wrap the interface if you'd prefer yo use it. While it focuses on JSON data, it includes all of Lucene's fulltext goodness.

In your case, you would make the public/private nature of the content being searched an attribute in the document that you provide to the indexer. You can then simply include/exclude the attribute on searches when users are logged in/out as needed.

This is blindly assuming that your site is powered by some variety of database-backed CMS. ElasticSearch isn't a crawler, you have to manually provide it the JSON documents you want searched.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.