Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ai
noblogs-wp
Commits
41778bed
Commit
41778bed
authored
Oct 10, 2011
by
shammash
Committed by
lechuck
Sep 20, 2015
Browse files
updated solr-for-wordpress to 0.4.1
parent
0b5a81c6
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
wp-content/plugins/solr-for-wordpress/Apache/Solr/Response.php
View file @
41778bed
...
...
@@ -124,8 +124,13 @@ class Apache_Solr_Response
//Look for the Content-Type response header and determine type
//and encoding from it (if possible - such as 'Content-Type: text/plain; charset=UTF-8')
//Check for a chunked response and de-chunk it if necessary
foreach
(
$httpHeaders
as
$header
)
{
if
(
strncasecmp
(
$header
,
'Transfer-Encoding: chunked'
,
26
)
==
0
)
{
$rawResponse
=
$this
->
http_chunked_decode
(
$rawResponse
);
}
if
(
strncasecmp
(
$header
,
'Content-Type:'
,
13
)
==
0
)
{
//split content type value into two parts if possible
...
...
@@ -158,6 +163,47 @@ class Apache_Solr_Response
$this
->
_collapseSingleValueArrays
=
(
bool
)
$collapseSingleValueArrays
;
}
/**
* dechunk an http 'transfer-encoding: chunked' message
*
* @param string $chunk the encoded message
* @return string the decoded message. If $chunk wasn't encoded properly it will be returned unmodified.
*/
protected
function
http_chunked_decode
(
$chunk
)
{
$pos
=
0
;
$len
=
strlen
(
$chunk
);
$dechunk
=
null
;
while
((
$pos
<
$len
)
&&
(
$chunkLenHex
=
substr
(
$chunk
,
$pos
,
(
$newlineAt
=
strpos
(
$chunk
,
"
\n
"
,
$pos
+
1
))
-
$pos
)))
{
if
(
!
$this
->
is_hex
(
$chunkLenHex
))
{
trigger_error
(
'Value is not properly chunk encoded'
,
E_USER_WARNING
);
return
$chunk
;
}
$pos
=
$newlineAt
+
1
;
$chunkLen
=
hexdec
(
rtrim
(
$chunkLenHex
,
"
\r\n
"
));
$dechunk
.
=
substr
(
$chunk
,
$pos
,
$chunkLen
);
$pos
=
strpos
(
$chunk
,
"
\n
"
,
$pos
+
$chunkLen
)
+
1
;
}
return
$dechunk
;
}
/**
* determine if a string can represent a number in hexadecimal
*
* @param string $hex
* @return boolean true if the string is a hex, otherwise false
*/
protected
function
is_hex
(
$hex
)
{
// regex is for weenies
$hex
=
strtolower
(
trim
(
ltrim
(
$hex
,
"0"
)));
if
(
empty
(
$hex
))
{
$hex
=
0
;
};
$dec
=
hexdec
(
$hex
);
return
(
$hex
==
dechex
(
$dec
));
}
/**
* Get the HTTP status code
*
...
...
@@ -276,4 +322,4 @@ class Apache_Solr_Response
$this
->
_parsedData
=
$data
;
}
}
\ No newline at end of file
}
wp-content/plugins/solr-for-wordpress/Apache/Solr/Service.php
View file @
41778bed
...
...
@@ -737,6 +737,7 @@ class Apache_Solr_Service
foreach
(
$document
as
$key
=>
$value
)
{
$key
=
htmlspecialchars
(
$key
,
ENT_QUOTES
,
'UTF-8'
);
$key
=
preg_replace
(
'/\pC/u'
,
''
,
$key
);
// remove unicode Control chars.
$fieldBoost
=
$document
->
getFieldBoost
(
$key
);
if
(
is_array
(
$value
))
...
...
@@ -754,7 +755,8 @@ class Apache_Solr_Service
}
$multivalue
=
htmlspecialchars
(
$multivalue
,
ENT_NOQUOTES
,
'UTF-8'
);
$multivalue
=
preg_replace
(
'/\pC/u'
,
''
,
$multivalue
);
// remove unicode Control chars.
$xml
.
=
'>'
.
$multivalue
.
'</field>'
;
}
}
...
...
@@ -768,6 +770,7 @@ class Apache_Solr_Service
}
$value
=
htmlspecialchars
(
$value
,
ENT_NOQUOTES
,
'UTF-8'
);
$value
=
preg_replace
(
'/\pC/u'
,
''
,
$value
);
// remove unicode Control chars.
$xml
.
=
'>'
.
$value
.
'</field>'
;
}
...
...
@@ -894,6 +897,8 @@ class Apache_Solr_Service
*/
public
function
search
(
$query
,
$offset
=
0
,
$limit
=
10
,
$params
=
array
())
{
$searchurl
=
$this
->
_searchUrl
;
if
(
!
is_array
(
$params
))
{
$params
=
array
();
...
...
@@ -903,6 +908,11 @@ class Apache_Solr_Service
// sending the version is important in case the format changes
$params
[
'version'
]
=
self
::
SOLR_VERSION
;
if
(
$params
[
'qt'
]
&&
substr
(
$params
[
'qt'
],
0
,
1
)
===
"/"
)
{
$searchurl
=
$this
->
_constructUrl
(
substr
(
$params
[
'qt'
],
1
));
unset
(
$params
[
'qt'
]);
}
// common parameters in this interface
$params
[
'wt'
]
=
self
::
SOLR_WRITER
;
$params
[
'json.nl'
]
=
$this
->
_namedListTreatment
;
...
...
@@ -921,6 +931,6 @@ class Apache_Solr_Service
// anywhere else the regex isn't expecting it
$queryString
=
preg_replace
(
'/%5B(?:[0-9]|[1-9][0-9]+)%5D=/'
,
'='
,
$queryString
);
return
$this
->
_sendRawGet
(
$
this
->
_
search
U
rl
.
$this
->
_queryDelimiter
.
$queryString
);
return
$this
->
_sendRawGet
(
$search
u
rl
.
$this
->
_queryDelimiter
.
$queryString
);
}
}
\ No newline at end of file
wp-content/plugins/solr-for-wordpress/readme.txt
View file @
41778bed
=== Solr for WordPress ===
Contributors: mattweber
Author URI: http://www.mattweber.org
Plugin URI: https://
launchpad.net/solr4
wordpress
Plugin URI: https://
github.com/mattweber/solr-for-
wordpress
Donate link: http://www.mattweber.org
Tags: solr, search, search results, search integration, custom search
Requires at least:
2.7
.0
Tested up to:
2.7
.1
Stable tag: 0.
2.0
Requires at least:
3
.0
Tested up to:
3.2
.1
Stable tag: 0.
4.1
A WordPress plugin that replaces the default WordPress search with Solr.
...
...
@@ -16,6 +16,8 @@ A WordPress plugin that replaces the default WordPress search with Solr. Featur
* Index pages and posts
* Enable faceting on fields such as tags, categories, author, and page type.
* Indexing and faceting on custom fields
* Multisite support
* Treat the category facet as a taxonomy
* Add special template tags so you can create your own custom result pages to match your theme.
* Completely replaces default WordPress search, just install and configure.
...
...
@@ -44,16 +46,25 @@ A WordPress plugin that replaces the default WordPress search with Solr. Featur
= What version of WordPress does Solr for WordPress work with? =
Solr for WordPress works with WordPress
2.7
.0 and greater.
Solr for WordPress works with WordPress
3
.0 and greater.
= What version of Solr is required. =
Solr 1.
3
or greater.
Solr 1.
4
or greater.
= Can I enable
dis
/disable specific facets. =
= Can I enable/disable specific facets. =
Yes, from the settings page. Uncheck the "Facet on FIELD" option, for the FIELD you don't want a facet for.
= Do I need to run my own Solr server to use this plugin? =
No, there are Solr hosting providers that will setup and manager Solr for you. As long as they allow custom schema's and support the
standard Solr http api, then the plugin should work. Some sites:
http://www.mysolrserver.com/
http://www.websolr.com/
http://powcloud.com/
= What is a taxonomy =
A taxonomy is a hierarchal facet. This means that your subcategories will be treated as a child to the parent category instead of an individual facet.
...
...
@@ -115,3 +126,7 @@ Login to the WordPress admin, select pages, click the page you want to exclude.
1. Configuration Page
2. Example of results page in default WordPress Theme
== Credits ==
Dominique Bejean for custom field support.
wp-content/plugins/solr-for-wordpress/schema.xml
View file @
41778bed
...
...
@@ -29,8 +29,7 @@
<fieldType
name=
"text"
class=
"solr.TextField"
positionIncrementGap=
"100"
>
<analyzer
type=
"index"
>
<tokenizer
class=
"solr.HTMLStripWhitespaceTokenizerFactory"
/>
<filter
class=
"solr.StopFilterFactory"
ignoreCase=
"true"
words=
"stopwords.txt"
enablePositionIncrements=
"true"
/>
<tokenizer
class=
"solr.WhitespaceTokenizerFactory"
/>
<filter
class=
"solr.WordDelimiterFilterFactory"
generateWordParts=
"1"
generateNumberParts=
"1"
catenateWords=
"1"
catenateNumbers=
"1"
catenateAll=
"0"
splitOnCaseChange=
"1"
/>
<filter
class=
"solr.LowerCaseFilterFactory"
/>
<filter
class=
"solr.EnglishPorterFilterFactory"
protected=
"protwords.txt"
/>
...
...
@@ -39,7 +38,6 @@
<analyzer
type=
"query"
>
<tokenizer
class=
"solr.WhitespaceTokenizerFactory"
/>
<filter
class=
"solr.SynonymFilterFactory"
synonyms=
"synonyms.txt"
ignoreCase=
"true"
expand=
"true"
/>
<filter
class=
"solr.StopFilterFactory"
ignoreCase=
"true"
words=
"stopwords.txt"
enablePositionIncrements=
"true"
/>
<filter
class=
"solr.WordDelimiterFilterFactory"
generateWordParts=
"1"
generateNumberParts=
"1"
catenateWords=
"0"
catenateNumbers=
"0"
catenateAll=
"0"
splitOnCaseChange=
"1"
/>
<filter
class=
"solr.LowerCaseFilterFactory"
/>
<filter
class=
"solr.EnglishPorterFilterFactory"
protected=
"protwords.txt"
/>
...
...
@@ -82,10 +80,17 @@
<fields>
<field
name=
"id"
type=
"string"
indexed=
"true"
stored=
"true"
required=
"true"
/>
<field
name=
"blogid"
type=
"string"
indexed=
"true"
stored=
"true"
/>
<field
name=
"blogdomain"
type=
"string"
indexed=
"true"
stored=
"true"
/>
<field
name=
"blogpath"
type=
"string"
indexed=
"true"
stored=
"true"
/>
<field
name=
"wp"
type=
"string"
indexed=
"true"
stored=
"true"
/>
<field
name=
"permalink"
type=
"string"
indexed=
"true"
stored=
"true"
/>
<field
name=
"title"
type=
"text_lws"
indexed=
"true"
stored=
"true"
/>
<field
name=
"content"
type=
"text"
indexed=
"true"
stored=
"true"
/>
<field
name=
"numcomments"
type=
"integer"
indexed=
"true"
stored=
"true"
/>
<field
name=
"comments"
type=
"text"
indexed=
"true"
stored=
"true"
multiValued=
"true"
/>
<field
name=
"categories"
type=
"string"
indexed=
"true"
stored=
"true"
multiValued=
"true"
/>
<field
name=
"categoriessrch"
type=
"text_lws"
indexed=
"true"
stored=
"false"
multiValued=
"true"
/>
...
...
@@ -96,10 +101,25 @@
<field
name=
"author"
type=
"string"
indexed=
"true"
stored=
"true"
/>
<field
name=
"type"
type=
"string"
indexed=
"true"
stored=
"true"
/>
<!-- Date fields used for sorting and searching -->
<field
name=
"date"
type=
"date"
indexed=
"true"
stored=
"false"
/>
<field
name=
"modified"
type=
"date"
indexed=
"true"
stored=
"false"
/>
<!-- Fields used to display the date -->
<field
name=
"displaydate"
type=
"string"
indexed=
"false"
stored=
"true"
/>
<field
name=
"displaymodified"
type=
"string"
indexed=
"false"
stored=
"true"
/>
<!-- For spell checking, did you mean? -->
<field
name=
"spell"
type=
"textSpell"
indexed=
"true"
stored=
"true"
multiValued=
"true"
/>
<!-- composite field -->
<field
name=
"text"
type=
"text"
indexed=
"true"
stored=
"false"
multiValued=
"true"
/>
<!-- dynamic fields -->
<dynamicField
name=
"*_str"
type=
"string"
indexed=
"true"
stored=
"true"
multiValued=
"true"
/>
<dynamicField
name=
"*_srch"
type=
"text_lws"
indexed=
"true"
stored=
"false"
multiValued=
"true"
/>
<dynamicField
name=
"*_taxonomy"
type=
"string"
indexed=
"true"
stored=
"true"
multiValued=
"true"
/>
<dynamicField
name=
"*_i"
type=
"sint"
indexed=
"true"
stored=
"true"
/>
<dynamicField
name=
"*_s"
type=
"string"
indexed=
"true"
stored=
"true"
/>
<dynamicField
name=
"*_l"
type=
"slong"
indexed=
"true"
stored=
"true"
/>
...
...
@@ -120,5 +140,7 @@
<copyField
source=
"content"
dest=
"text"
/>
<copyField
source=
"tags"
dest=
"tagssrch"
/>
<copyField
source=
"categories"
dest=
"categoriessrch"
/>
<copyField
source=
"title"
dest=
"spell"
/>
<copyField
source=
"content"
dest=
"spell"
/>
<copyField
source=
"author"
dest=
"spell"
/>
</schema>
wp-content/plugins/solr-for-wordpress/solr-for-wordpress.php
View file @
41778bed
This diff is collapsed.
Click to expand it.
wp-content/plugins/solr-for-wordpress/solr-options-page.php
View file @
41778bed
...
...
@@ -21,38 +21,95 @@
THE SOFTWARE.
*/
#set defaults
if
(
get_option
(
's4w_solr_initialized'
)
!=
'1'
)
{
update_option
(
's4w_solr_host'
,
'localhost'
);
update_option
(
's4w_solr_port'
,
'8983'
);
update_option
(
's4w_solr_path'
,
'/solr'
);
update_option
(
's4w_index_pages'
,
'1'
);
update_option
(
's4w_index_posts'
,
'1'
);
update_option
(
's4w_delete_page'
,
'1'
);
update_option
(
's4w_delete_post'
,
'1'
);
update_option
(
's4w_private_page'
,
'1'
);
update_option
(
's4w_private_post'
,
'1'
);
update_option
(
's4w_output_info'
,
'1'
);
update_option
(
's4w_output_pager'
,
'1'
);
update_option
(
's4w_output_facets'
,
'1'
);
update_option
(
's4w_exclude_pages'
,
array
());
update_option
(
's4w_num_results'
,
'5'
);
update_option
(
's4w_cat_as_taxo'
,
'1'
);
update_option
(
's4w_solr_initialized'
,
'1'
);
update_option
(
's4w_max_display_tags'
,
'10'
);
update_option
(
's4w_facet_on_categories'
,
'1'
);
update_option
(
's4w_facet_on_tags'
,
'1'
);
update_option
(
's4w_facet_on_author'
,
'1'
);
update_option
(
's4w_facet_on_type'
,
'1'
);
#set defaults if not initialized
if
(
s4w_get_option
(
's4w_solr_initialized'
)
!=
'1'
)
{
update_site_option
(
's4w_index_all_sites'
,
'0'
);
s4w_update_option
(
's4w_solr_host'
,
'localhost'
);
s4w_update_option
(
's4w_solr_port'
,
'8983'
);
s4w_update_option
(
's4w_solr_path'
,
'/solr'
);
s4w_update_option
(
's4w_index_pages'
,
'1'
);
s4w_update_option
(
's4w_index_posts'
,
'1'
);
s4w_update_option
(
's4w_delete_page'
,
'1'
);
s4w_update_option
(
's4w_delete_post'
,
'1'
);
s4w_update_option
(
's4w_private_page'
,
'1'
);
s4w_update_option
(
's4w_private_post'
,
'1'
);
s4w_update_option
(
's4w_output_info'
,
'1'
);
s4w_update_option
(
's4w_output_pager'
,
'1'
);
s4w_update_option
(
's4w_output_facets'
,
'1'
);
//s4w_update_option('s4w_exclude_pages', array());
s4w_update_option
(
's4w_exclude_pages'
,
''
);
s4w_update_option
(
's4w_num_results'
,
'5'
);
s4w_update_option
(
's4w_cat_as_taxo'
,
'1'
);
s4w_update_option
(
's4w_solr_initialized'
,
'1'
);
s4w_update_option
(
's4w_max_display_tags'
,
'10'
);
s4w_update_option
(
's4w_facet_on_categories'
,
'1'
);
s4w_update_option
(
's4w_facet_on_taxonomy'
,
'1'
);
s4w_update_option
(
's4w_facet_on_tags'
,
'1'
);
s4w_update_option
(
's4w_facet_on_author'
,
'1'
);
s4w_update_option
(
's4w_facet_on_type'
,
'1'
);
s4w_update_option
(
's4w_enable_dym'
,
'1'
);
s4w_update_option
(
's4w_index_comments'
,
'1'
);
s4w_update_option
(
's4w_connect_type'
,
'solr'
);
//s4w_update_option('s4w_index_custom_fields', array());
//s4w_update_option('s4w_facet_on_custom_fields', array());
s4w_update_option
(
's4w_index_custom_fields'
,
''
);
s4w_update_option
(
's4w_facet_on_custom_fields'
,
''
);
}
wp_reset_vars
(
array
(
'action'
));
# save form settings if we get the update action
# we do saving here instead of using options.php because we need to use
# s4w_update_option instead of update option.
if
(
$_POST
[
'action'
]
==
'update'
)
{
$options
=
array
(
's4w_solr_host'
,
's4w_solr_port'
,
's4w_solr_path'
,
's4w_index_pages'
,
's4w_index_posts'
,
's4w_delete_page'
,
's4w_delete_post'
,
's4w_private_page'
,
's4w_private_post'
,
's4w_output_info'
,
's4w_output_pager'
,
's4w_output_facets'
,
's4w_exclude_pages'
,
's4w_num_results'
,
's4w_cat_as_taxo'
,
's4w_max_display_tags'
,
's4w_facet_on_categories'
,
's4w_facet_on_tags'
,
's4w_facet_on_author'
,
's4w_facet_on_type'
,
's4w_enable_dym'
,
's4w_index_comments'
,
's4w_connect_type'
,
's4w_index_all_sites'
,
's4w_index_custom_fields'
,
's4w_facet_on_custom_fields'
,
's4w_facet_on_taxonomy'
);
foreach
(
$options
as
$option
)
{
$option
=
trim
(
$option
);
$value
=
null
;
if
(
isset
(
$_POST
[
$option
])
)
$value
=
$_POST
[
$option
];
if
(
!
is_array
(
$value
)
)
$value
=
trim
(
$value
);
$value
=
stripslashes_deep
(
$value
);
if
(
$option
==
's4w_index_all_sites'
)
{
update_site_option
(
$option
,
$value
);
}
else
{
s4w_update_option
(
$option
,
$value
);
}
}
?>
<div
id=
"message"
class=
"updated fade"
><p><strong>
<?php
_e
(
'Success!'
,
'solr4wp'
)
?>
</strong></p></div>
<?php
}
# checks if we need to check the checkbox
function
s4w_checkCheckbox
(
$theFieldname
)
{
if
(
get_option
(
$theFieldname
)
==
'1'
){
echo
'checked="checked"'
;
if
(
$theFieldname
==
's4w_index_all_sites'
)
{
if
(
get_site_option
(
$theFieldname
)
==
'1'
)
{
echo
'checked="checked"'
;
}
}
else
{
if
(
s4w_get_option
(
$theFieldname
)
==
'1'
){
echo
'checked="checked"'
;
}
}
}
function
s4w_checkConnectOption
(
$connectType
)
{
if
(
s4w_get_option
(
's4w_connect_type'
)
===
$connectType
)
{
echo
'checked="checked"'
;
}
}
# check for any POST settings
if
(
$_POST
[
's4w_ping'
])
{
if
(
s4w_get_solr
(
true
))
{
...
...
@@ -64,45 +121,47 @@ if ($_POST['s4w_ping']) {
<div
id=
"message"
class=
"updated fade"
><p><strong>
<?php
_e
(
'Ping Failed!'
,
'solr4wp'
)
?>
</strong></p></div>
<?php
}
}
else
if
(
$_POST
[
's4w_pageload'
])
{
s4w_load_all_pages
();
?>
<div
id=
"message"
class=
"updated fade"
><p><strong>
<?php
_e
(
'Pages Loaded!'
,
'solr4wp'
)
?>
</strong></p></div>
<?php
}
else
if
(
$_POST
[
's4w_postload'
])
{
s4w_load_all_posts
();
?>
<div
id=
"message"
class=
"updated fade"
><p><strong>
<?php
_e
(
'Posts Loaded!'
,
'solr4wp'
)
?>
</strong></p></div>
<?php
}
else
if
(
$_POST
[
's4w_deleteall'
])
{
s4w_delete_all
();
?>
<div
id=
"message"
class=
"updated fade"
><p><strong>
<?php
_e
(
'All Indexed Pages Deleted!'
,
'solr4wp'
)
?>
</strong></p></div>
<?php
}
else
if
(
$_POST
[
's4w_optimize'
])
{
s4w_optimize
();
?>
<div
id=
"message"
class=
"updated fade"
><p><strong>
<?php
_e
(
'Index Optimized!'
,
'solr4wp'
)
?>
</strong></p></div>
<?php
}
?>
<div
class=
"wrap"
>
<h2>
<?php
_e
(
'Solr For WordPress'
,
'solr4wp'
)
?>
</h2>
<form
method=
"post"
action=
"options.php"
>
<h3>
<?php
_e
(
'Connection Information'
,
'solr4wp'
)
?>
</h3>
<table
class=
"form-table"
>
<tr
valign=
"top"
>
<th
scope=
"row"
>
<?php
_e
(
'Solr Host'
,
'solr4wp'
)
?>
</th>
<td><input
type=
"text"
name=
"s4w_solr_host"
value=
"
<?php
_e
(
get_option
(
's4w_solr_host'
),
'solr4wp'
);
?>
"
/></td>
</tr>
<tr
valign=
"top"
>
<th
scope=
"row"
>
<?php
_e
(
'Solr Port'
,
'solr4wp'
)
?>
</th>
<td><input
type=
"text"
name=
"s4w_solr_port"
value=
"
<?php
_e
(
get_option
(
's4w_solr_port'
),
'solr4wp'
);
?>
"
/></td>
</tr>
<form
method=
"post"
action=
"options-general.php?page=solr-for-wordpress/solr-for-wordpress.php"
>
<h3>
<?php
_e
(
'Configure Solr'
,
'solr4wp'
)
?>
</h3>
<tr
valign=
"top"
>
<th
scope=
"row"
>
<?php
_e
(
'Solr Path'
,
'solr4wp'
)
?>
</th>
<td><input
type=
"text"
name=
"s4w_solr_path"
value=
"
<?php
_e
(
get_option
(
's4w_solr_path'
),
'solr4wp'
);
?>
"
/></td>
</tr>
</table>
<div
class=
"solr_admin clearfix"
>
<div
class=
"solr_adminR"
>
<div
class=
"solr_adminR2"
id=
"solr_admin_tab2"
>
<label>
<?php
_e
(
'Solr Host'
,
'solr4wp'
)
?>
</label>
<p><input
type=
"text"
name=
"s4w_solr_host"
value=
"
<?php
_e
(
s4w_get_option
(
's4w_solr_host'
),
'solr4wp'
);
?>
"
/></p>
<label>
<?php
_e
(
'Solr Port'
,
'solr4wp'
)
?>
</label>
<p><input
type=
"text"
name=
"s4w_solr_port"
value=
"
<?php
_e
(
s4w_get_option
(
's4w_solr_port'
),
'solr4wp'
);
?>
"
/></p>
<label>
<?php
_e
(
'Solr Path'
,
'solr4wp'
)
?>
</label>
<p><input
type=
"text"
name=
"s4w_solr_path"
value=
"
<?php
_e
(
s4w_get_option
(
's4w_solr_path'
),
'solr4wp'
);
?>
"
/></p>
</div>
</div>
<ol>
<li
id=
"solr_admin_tab1_btn"
class=
"solr_admin_tab1"
>
</li>
<li
id=
"solr_admin_tab2_btn"
class=
"solr_admin_tab2"
>
<h4><input
id=
"solrconnect"
name=
"s4w_connect_type"
type=
"radio"
value=
"solr"
<?php
s4w_checkConnectOption
(
'solr'
);
?>
onclick=
"switch1();"
/>
Solr Server
</h4>
<ol>
<li>
Download, install and configure your own
<a
href=
""
>
Apache Solr 1.4
</a>
instance
</li>
</ol>
</li>
</ol>
</div>
<hr
/>
<h3>
<?php
_e
(
'Indexing Options'
,
'solr4wp'
)
?>
</h3>
<table
class=
"form-table"
>
...
...
@@ -128,8 +187,29 @@ if ($_POST['s4w_ping']) {
</tr>
<tr
valign=
"top"
>
<th
scope=
"row"
>
<?php
_e
(
'Excludes (comma-separated integer ids)'
,
'solr4wp'
)
?>
</th>
<td><input
type=
"text"
name=
"s4w_exclude_pages"
value=
"
<?php
_e
(
s4w_filter_list2str
(
get_option
(
's4w_exclude_pages'
)),
'solr4wp'
);
?>
"
/></td>
<th
scope=
"row"
style=
"width:200px;"
>
<?php
_e
(
'Index Comments'
,
'solr4wp'
)
?>
</th>
<td
style=
"width:10px;float:left;"
><input
type=
"checkbox"
name=
"s4w_index_comments"
value=
"1"
<?php
echo
s4w_checkCheckbox
(
's4w_index_comments'
);
?>
/></td>
</tr>
<?php
//is this a multisite installation
if
(
is_multisite
()
&&
is_main_site
())
{
?>
<tr
valign=
"top"
>
<th
scope=
"row"
style=
"width:200px;"
>
<?php
_e
(
'Index all Sites'
,
'solr4wp'
)
?>
</th>
<td
style=
"width:10px;float:left;"
><input
type=
"checkbox"
name=
"s4w_index_all_sites"
value=
"1"
<?php
echo
s4w_checkCheckbox
(
's4w_index_all_sites'
);
?>
/></td>
</tr>
<?php
}
?>
<tr
valign=
"top"
>
<th
scope=
"row"
>
<?php
_e
(
'Index custom fields (comma separated names list)'
)
?>
</th>
<td><input
type=
"text"
name=
"s4w_index_custom_fields"
value=
"
<?php
print
(
s4w_filter_list2str
(
s4w_get_option
(
's4w_index_custom_fields'
),
'solr4wp'
));
?>
"
/></td>
</tr>
<tr
valign=
"top"
>
<th
scope=
"row"
>
<?php
_e
(
'Excludes Posts or Pages (comma separated ids list)'
)
?>
</th>
<td><input
type=
"text"
name=
"s4w_exclude_pages"
value=
"
<?php
print
(
s4w_filter_list2str
(
s4w_get_option
(
's4w_exclude_pages'
),
'solr4wp'
));
?>
"
/></td>
</tr>
</table>
<hr
/>
...
...
@@ -162,22 +242,38 @@ if ($_POST['s4w_ping']) {
<th
scope=
"row"
style=
"width:200px;float:left;margin-left:20px;"
>
<?php
_e
(
'Type as Facet'
,
'solr4wp'
)
?>
</th>
<td
style=
"width:10px;float:left;"
><input
type=
"checkbox"
name=
"s4w_facet_on_type"
value=
"1"
<?php
echo
s4w_checkCheckbox
(
's4w_facet_on_type'
);
?>
/></td>
</tr>
<tr
valign=
"top"
>
<th
scope=
"row"
style=
"width:200px;"
>
<?php
_e
(
'Taxonomy as Facet'
,
'solr4wp'
)
?>
</th>
<td
style=
"width:10px;float:left;"
><input
type=
"checkbox"
name=
"s4w_facet_on_taxonomy"
value=
"1"
<?php
echo
s4w_checkCheckbox
(
's4w_facet_on_taxonomy'
);
?>
/></td>
</tr>
<tr
valign=
"top"
>
<th
scope=
"row"
>
<?php
_e
(
'Custom fields as Facet (comma separated ordered names list)'
)
?>
</th>
<td><input
type=
"text"
name=
"s4w_facet_on_custom_fields"
value=
"
<?php
print
(
s4w_filter_list2str
(
s4w_get_option
(
's4w_facet_on_custom_fields'
),
'solr4wp'
));
?>
"
/></td>
</tr>
<tr
valign=
"top"
>
<th
scope=
"row"
style=
"width:200px;"
>
<?php
_e
(
'Enable Spellchecking'
,
'solr4wp'
)
?>
</th>
<td
style=
"width:10px;float:left;"
><input
type=
"checkbox"
name=
"s4w_enable_dym"
value=
"1"
<?php
echo
s4w_checkCheckbox
(
's4w_enable_dym'
);
?>
/></td>
</tr>
<tr
valign=
"top"
>
<th
scope=
"row"
>
<?php
_e
(
'Number of Results Per Page'
,
'solr4wp'
)
?>
</th>
<td><input
type=
"text"
name=
"s4w_num_results"
value=
"
<?php
_e
(
get_option
(
's4w_num_results'
),
'solr4wp'
);
?>
"
/></td>
<td><input
type=
"text"
name=
"s4w_num_results"
value=
"
<?php
_e
(
s4w_
get_option
(
's4w_num_results'
),
'solr4wp'
);
?>
"
/></td>
</tr>
<tr
valign=
"top"
>
<th
scope=
"row"
>
<?php
_e
(
'Max Number of Tags to Display'
,
'solr4wp'
)
?>
</th>
<td><input
type=
"text"
name=
"s4w_max_display_tags"
value=
"
<?php
_e
(
get_option
(
's4w_max_display_tags'
),
'solr4wp'
);
?>
"
/></td>
<td><input
type=
"text"
name=
"s4w_max_display_tags"
value=
"
<?php
_e
(
s4w_
get_option
(
's4w_max_display_tags'
),
'solr4wp'
);
?>
"
/></td>
</tr>
</table>
<hr
/>
<?php
settings_fields
(
's4w-options-group'
);
?>
<p
class=
"submit"
>
<input
type=
"submit"
class=
"button-primary"
value=
"
<?php
_e
(
'Save Changes'
,
'solr4wp'
)
?>
"
/>
<input
type=
"hidden"
name=
"action"
value=
"update"
/>
<input
id=
"settingsbutton"
type=
"submit"
class=
"button-primary"
value=
"
<?php
_e
(
'Save Changes'
,
'solr4wp'
)
?>
"
/>
</p>
</form>
...
...
@@ -200,6 +296,11 @@ if ($_POST['s4w_ping']) {
<td><input
type=
"submit"
class=
"button-primary"
name=
"s4w_postload"
value=
"
<?php
_e
(
'Execute'
,
'solr4wp'
)
?>
"
/></td>
</tr>
<tr
valign=
"top"
>
<th
scope=
"row"
>
<?php
_e
(
'Optimize Index'
,
'solr4wp'
)
?>
</th>
<td><input
type=
"submit"
class=
"button-primary"
name=
"s4w_optimize"
value=
"
<?php
_e
(
'Execute'
,
'solr4wp'
)
?>
"
/></td>
</tr>
<tr
valign=
"top"
>
<th
scope=
"row"
>
<?php
_e
(
'Delete All'
,
'solr4wp'
)
?>
</th>
<td><input
type=
"submit"
class=
"button-primary"
name=
"s4w_deleteall"
value=
"
<?php
_e
(
'Execute'
,
'solr4wp'
)
?>
"
/></td>
...
...
@@ -207,4 +308,4 @@ if ($_POST['s4w_ping']) {
</table>
</form>
</div>
\ No newline at end of file
</div>
wp-content/plugins/solr-for-wordpress/template/autocomplete.css
0 → 100644
View file @
41778bed
.ac_results
{
border
:
1px
solid
gray
;
background-color
:
white
;
padding
:
0
;
margin
:
0
;
list-style
:
none
;
position
:
absolute
;
z-index
:
10000
;
display
:
none
;
}
.ac_results
li
{
padding
:
2px
5px
;
white-space
:
nowrap
;
color
:
#101010
;
text-align
:
left
;
}
.ac_over
{
cursor
:
pointer
;
background-color
:
#F0F0B8
;
}
.ac_match
{
text-decoration
:
underline
;
color
:
black
;
}
\ No newline at end of file
wp-content/plugins/solr-for-wordpress/template/s4w_search.php
View file @
41778bed
...
...
@@ -6,11 +6,155 @@ Template Name: Search
<?php
get_header
();
?>
<div
id=
"content"
>
<div
id=
"form"
>
<?php
s4w_search_form
();
?>
</div>
<div
id=
"resultwrap"
>
<?php
s4w_search_results
();
?>
</div>
<div
class=
"solr clearfix"
>
<?php
$results
=
s4w_search_results
();
?>
<div
class=
"solr1 clearfix"
>
<div
class=
"solr_search"
>
<?php
if
(
$results
[
'qtime'
])
{
printf
(
"<label class='solr_response'>Response time: <span id=
\"
qrytime
\"
>
{
$results
[
'qtime'
]
}
</span> s</label>"
);