mattweber / solr-for-wordpress Goto Github PK
View Code? Open in Web Editor NEWA WordPress plugin that replaces the default WordPress search with Solr
A WordPress plugin that replaces the default WordPress search with Solr
-> the facet selection is lost
search still works but the autocomplete shows error.
This is with a vanilla install of WP 3.2.1
[Sun Aug 28 19:10:45 2011] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'Exception' with message '"404" Status: Not Found' in /Users/shaksi/Sites/wordpress/wp-content/plugins/solr-for-wordpress/Apache/Solr/Service.php:294\nStack trace:\n#0 /Users/shaksi/Sites/wordpress/wp-content/plugins/solr-for-wordpress/Apache/Solr/Service.php(934): Apache_Solr_Service->_sendRawGet('http://localhos...')\n#1 /Users/shaksi/Sites/wordpress/wp-content/plugins/solr-for-wordpress/solr-for-wordpress.php(1281): Apache_Solr_Service->search('post', 0, NULL, Array)\n#2 /Users/shaksi/Sites/wordpress/wp-content/plugins/solr-for-wordpress/solr-for-wordpress.php(1149): s4w_autocomplete('post', NULL)\n#3 [internal function]: s4w_template_redirect('')\n#4 /Users/shaksi/Sites/wordpress/wp-includes/plugin.php(405): call_user_func_array('s4w_template_re...', Array)\n#5 /Users/shaksi/Sites/wordpress/wp-includes/template-loader.php(7): do_action('template_redire...')\n#6 /Users/shaksi/Sites/wordpress/wp-blog-header.php(16): require_once('/Users/shaksi/S...')\n#7 /Users/shaksi/Sites/wordpress/index.php(17) in /Users/shaksi/Sites/wordpress/wp-content/plugins/solr-for-wordpress/Apache/Solr/Service.php on line 294, referer: http://wp.local/?s=post
Calling utf8_encode in SolrPhpClient/Apache/Solr/Service.php on line 770 destroys multibyte characters.
Suggested change: (might also be good to add before calling htmlspecialchars on line 787 in the same file )
if( !seems_utf8($multivalue) )
$multivalue = utf8_encode($multivalue);
Configuring a single Solr server doesn't work and it seems it is because the option fields for the master/slave setup clobber the single server options. If I configure the master/slave fields then my single server fields will update, but not the other way around
The plugins doesn't work anymore.
I had to comment 2 lines in solr-options-page.php file
foreach( $options as $key => $value ) {
if( $existing = get_option($key)) {
//krumo( $existing);
$options[$key] = $existing;
delete_option($key);
$indexall = FALSE;
//$option_function($key);
}
}
Furthermore, it looks like settings are sometimes reset to default (I am investigating)
The plugin works fine with Solr 3.x, so the following string
"Download, install and configure your own Apache Solr 1.4 instance"
should be changed into
"Download, install and configure your own Apache Solr instance"
Hi!
I installed a fresh version of WP, version 3.3.1, and then installed the latest Solr for Wordpress plug-in but when I try to save the settings I get a "You do not have sufficient permissions to access this page." error. I use the "Single Server" mode. I first ran into this problem trying to install it on my Debian VPS but I get exactly the same error using my WAMP/Bitnami stack...
Any ideas of what's wrong here?
Many thanks!
Peter
I feel as the plugin matures the code base will grow quite quickly as it has done so in the past few months, making it hard to read through.
What are your thoughts on separating the wp configuration (or anything to do with it) into a different include file?
WP installs are getting a more complex nature, and support for custom post type would be a great addition to this plugin.
My registered taxonomies are not displaying in the facet items list. Can anyone confirm?
Is there a way to do wildcard searches with the plugin on the page? I'm actually looking to just add this as the home page with a search of "All" so that I can use the filtering and faceting that is built into SOLR. On my Linux box I just do a : in the search for everything, but that doesn't work with the plugin.
Thanks,
Jerry
Hi - I found the following issue and will appreciate it if you can fix it
Environment: Centos 5.x 64 bit, server= jetty, solr: 3.5 multicore, Wordpress 3.3
Initial setup
Test Schema
4) Copy schema.xml from solrforwordpress plugin into core0/conf
5) restart solr
6) go to local host:8083 and you will not see core0 anymore
NOTE: same thing happens when I get the schema.xml from git
Test plugin
7)ignore the issue with core0 and enter its details in the plugin and Check Server comes back as Ping failed
8) use core1 instead of core0 (note core1 has default schema.xml and shows up in solr admin) . Same result of Ping failed
Thank you for this plugin and let me know if you have any questions on the setup
Fuji
The Drop Down for the "Sort by:" Relevance - Newest - Oldest - Most Comments - Least Comments isn't dropping down for me? Is there some sort of a Java Library I need to be loading on the page that I'm not or something like that? It doesn't look like the suckerfish css dropdown to me, so I'm not sure how it's supposed to be set up to work. Since so much of this is based on java I thought maybe there was something I was missing.
Thanks,
I am creating separate issue for ping failed instead of reusing #30
Environment: Centos 5.x 64 bit, server= jetty, Wordpress 3.3
When doing Check Server Settings I get ping failed.
Note: in all these cases I was able to use Solr's admin in the browser to get successful pings. Only failed through wordpress. I think its due to this but I get "Sorry, search is unavailable right now" when I try searching
Thanks,
Fuji
When installing the solr-for-wordpress debug mode is showing
'has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.'
On curtain WP install this affect the possibility to save solr-for-wordpress configuration, ending up with 'You do not have sufficient permissions to access this page' message.
Article on how to fix this - http://tumbledesign.com/fix-notice-has_cap-was-called-with-an-argument-that-is-deprecated-since-version-2-0-in-wordpress/
Wordpress documentation on User Levels - http://codex.wordpress.org/User_Levels
I'm looking for any documentation on how to integrate Apache Tika with the Solr for WordPress plugin. Would be great to index .PDF content and link to the corresponding post/page.
I'm doing my best to explore the functionality of this plugin and I would be interested in expanding the online documentation resources surrounding this plugin.
First, does this plugin support the use of synonyms.txt ? There are two analyzers that feature the SynonymFilterFactory in the schema.xml of the plugin directory.
A Query analyzer uses the WhitespaceTokenizerFactory and filters the synonyms.txt as featured on line 40, but it does not seem to do the job when I go and run a search.
I'm not sure what the second use of the SynonymFilterFactory is used for (see line 51).
Any help is greatly appreciated. Thanks!
Wordpress 4.6
After activating the plugin, entered solr server information and clicked "Save"
Received message
"Sorry, you are not allowed to access this page."
Hi,
I installed the plugin following your directions. I had a couple deprecation warnings that I fixed related to is_super_admin() and using roles and capabilities instead of levels, but I'm still not seeing any solr for wordpress settings page.
Im still getting an error from when s4w_options_init() is called:
Notice: Undefined index: method in /Library/WebServer/Documents/complex/wordpress/wp-content/plugins/solr-for-wordpress/solr-for-wordpress.php on line 933 Method is:
It appears s4w_add_pages() is never being called, which I see is what adds the options page that I need to get to.
I am using wordpress 3.2.1.
Any idea what is going on?
Thanks,
Dan
Everyone, thanks for all the work you have been doing on the plugin. WIth all these changes I think it would be a good time to push out a 0.5.0 version to the Wordpress Plugin site. Please test the latest version of the master branch and let me know if you have any issues. If not I will push out a 0.5.0 version in the next week or so.
Thanks,
Matt Weber
With FF 6.x, It looks like the handleResults callback function is not properly called after
$j.post("options-general.php?page=solr-for-wordpress/solr-for-wordpress.php", {method: "load", type: $type}, handleResults, "json");
So only the 100 first posts are sent to Solr but never commited.
It doesn't occured 100% but main of the time.
It works when I call $j.post in debug mode with Firebug.
Other people reported this issue.
http://bugs.jquery.com/ticket/10071
In the Wiki, you can specify the fields that you are searching for via this syntax:
q=superman&qf=title subject
But this doesn't seem to work in the Solr plugin. Also, the q parameter is replaced with an s in WordPress
I have an XML file which I have indexed using my PHP code and Solr. I have indexed based on the tags in the xml file. However, now i want to do that using wordpress. I was trying to do the same using solr-for-wordpress but havent reached any solution for that. Is it possible to do that using this plugin ?
Is it possible to create some sort of an Array for Post Types to check the database for? I know there is a way to do it, but am I the only one that seems interested in this? I'm working on my own stuff with the plugin, and I'm continually struggling with github to get it to work correctly.
Thanks,
After adding all posts, I'm trying to selectively index certain pages. I am wondering if I should follow the .xml syntax specified here: http://wiki.apache.org/solr/UpdateXmlMessages#add.2BAC8-replace_documents but I'm confused as to which fields I should insert data on. Any help would be greatly appreciated -Alex
So, after fixing the FF issue and using Chrome I was checking the index. If I do a "Load all Posts" and "Load all Pages" everything works correctly. However, if I then go back and "Update" one of the posts, then it adds a duplicate entry into the index and will give me 2 search results.
If I go back in and update a 2nd time on the same post I'm not getting a 3rd instance of the post in the results index though. If it picks up the Create Post then it's not adding another one on the Update Post. I'm guessing there is some sort of check that is missing in the "Load all Posts/Pages"
Thanks,
I've successfully index my custom taxonomy terms but they are not hierarchical like the categories field. I'm working on a fix but if anyone has a solution, let me know.
I'm not sure if I can get some help here but I'll try :)
A colleague and I were trying for a week to get solr for wordpress working on our linux (ubuntu) server though without any success.
By some reason the module wouldn't initiate communication with external server (seems no socket was ever tried to be open).
The firewall is not noticing any communication and even tcpdump doesn't catch any traffic.
Apache/php/syslog logs are not making us any smarter (no clue about what could be wrong).
We are using chroot environment for the users and external AD authentication (through Identity Management for UNIX role)with user owner of the folder and www-data as group owner.
Wordpress is working fine, solr module is installed and seems like it is working though ping failed is reported.
Does anybody have any suggestion what could cause this problem or give me any idea what we could check.
Hello! My goal is to get this plugin working with a local instance of solr.
I have a local instance of Solr. I am using Ubuntu/OpenJDK. I'm able to get to the admin screens of both solr and the solr-for-wordpress plugin.
My config settings in wordpress are:
host: localhost
port: 8983
path: /solr
However, when I copy the schema.xml provided by the plugin into the folder: /solr/example/solr/collection1/conf, I'm seeing this:
SEVERE: Unable to create core: collection1
org.apache.solr.common.SolrException: Plugin init failure for [schema.xml] fieldType "text": Plugin init failure for [schema.xml] analyzer/filter: Error loading class 'solr.EnglishPorterFilterFactory'
If the post contains something like
word1</h4>
<p>word2
strip_tags($post_info->post_content) converts this in
word1\r\n\r\n\r\nword2
then in Service.php, $rawPost .= $this->_documentToXmlFragment($document); converts this in
word1word2
due to the line
$value = preg_replace('/\pC/u', '', $value); // remove unicode Control chars.
so searching word1 do not return the document and the speelcheking suggests "word1word2"
the issue is in solr-php-client, but it should be workarounded in s4w_build_document with
$doc->setField( 'content', preg_replace('/\r\n/', ' ', strip_tags($post_info->post_content)) );
I installed a local version of solr. The server is currently running.
I installed wordpress 3.4.2 (latest) and downloaded and extracted solr-for-wordpress into the www/wordpress/wp-content/solr-for-wordpress directory
However, when I access wp-admin, I am unable to see solr-for-wordpress listed. I am able to see akismet, but not solr. I verified my permissions are correct and www-data is the owner of all the files.
Anyone else experience this?
Is there any particular reason why you haven't worked to convert this to MultiSite? Or for that matter to being used in the newer versions of WordPress? It doesn't seem all that difficult to just change the is_wpmu() to is_multisite()? Am I missing something bigger here?
I'm not sure I want to just index "my" content and since that part seemed to be the hardest part of doing a multisite search I had also already looked into using Nutch to crawl and index everything. If that's the case and the Index already exists where could I just use the Search Form portion of this plugin to display the Search results from Solr?
I'm running CentOS on the box I set up for this and my libxml2 is a like 2 versions back from what php.net suggests as the minimum is the whole thing going to crash if I try to do the work on this to update it?
And I'm new to github and colaborative development completely so I'm not sure how to even start this here or do I just do it all myself? I'd love to include it as part of the project here as a decent Search functionality is Seriously lacking in WordPress Multisite.
Thanks,
Jerry Craig
Cupbearer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.