Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
22213ac7
Commit
22213ac7
authored
Aug 18, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39 from Gasol/mlt_support
Lots of style, comment and copyright modification
parents
b96e9212
20cbe625
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
21 deletions
+56
-21
library/Solarium/Client.php
library/Solarium/Client.php
+5
-1
library/Solarium/Client/Adapter/PeclHttp.php
library/Solarium/Client/Adapter/PeclHttp.php
+10
-4
library/Solarium/Client/RequestBuilder/MoreLikeThis.php
library/Solarium/Client/RequestBuilder/MoreLikeThis.php
+6
-2
library/Solarium/Client/ResponseParser/MoreLikeThis.php
library/Solarium/Client/ResponseParser/MoreLikeThis.php
+8
-4
library/Solarium/Query/MoreLikeThis.php
library/Solarium/Query/MoreLikeThis.php
+12
-1
library/Solarium/Result/MoreLikeThis.php
library/Solarium/Result/MoreLikeThis.php
+9
-5
library/Solarium/Result/Select/MoreLikeThis.php
library/Solarium/Result/Select/MoreLikeThis.php
+3
-2
library/Solarium/Result/Select/MoreLikeThis/Result.php
library/Solarium/Result/Select/MoreLikeThis/Result.php
+3
-2
No files found.
library/Solarium/Client.php
View file @
22213ac7
...
...
@@ -71,6 +71,10 @@ class Solarium_Client extends Solarium_Configurable
* Querytype ping
*/
const
QUERYTYPE_PING
=
'ping'
;
/**
* Querytype morelikethis
*/
const
QUERYTYPE_MORELIKETHIS
=
'mlt'
;
/**
...
...
library/Solarium/Client/Adapter/PeclHttp.php
View file @
22213ac7
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
* Copyright 2011 Gasol Wu. PIXNET Digital Media Corporation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
...
...
@@ -28,9 +29,12 @@
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holder.
*
* @copyright Copyright 2011
Bas de Nooijer <solarium@raspberry.nl
>
* @copyright Copyright 2011
Gasol Wu <gasol.wu@gmail.com
>
* @license http://github.com/basdenooijer/solarium/raw/master/COPYING
* @link http://www.solarium-project.org/
*
* @package Solarium
* @subpackage Client
*/
/**
...
...
@@ -71,7 +75,8 @@ class Solarium_Client_Adapter_PeclHttp extends Solarium_Client_Adapter
if
(
!
isset
(
$options
[
'headers'
][
'Content-Type'
]))
{
$options
[
'headers'
][
'Content-Type'
]
=
'text/xml; charset=utf-8'
;
}
$httpResponse
=
http_post_data
(
$uri
,
$request
->
getRawData
(),
$options
);
$httpResponse
=
http_post_data
(
$uri
,
$request
->
getRawData
(),
$options
);
}
else
if
(
$method
==
Solarium_Client_Request
::
METHOD_GET
)
{
$httpResponse
=
http_get
(
$uri
,
$options
);
}
else
if
(
$method
==
Solarium_Client_Request
::
METHOD_HEAD
)
{
...
...
@@ -85,7 +90,8 @@ class Solarium_Client_Adapter_PeclHttp extends Solarium_Client_Adapter
if
(
$message
=
http_parse_message
(
$httpResponse
))
{
$data
=
$message
->
body
;
if
(
$firstPositionOfCRLF
=
strpos
(
$httpResponse
,
"
\r\n\r\n
"
))
{
$headersAsString
=
substr
(
$httpResponse
,
0
,
$firstPositionOfCRLF
);
$headersAsString
=
substr
(
$httpResponse
,
0
,
$firstPositionOfCRLF
);
$headers
=
explode
(
"
\n
"
,
$headersAsString
);
}
}
...
...
library/Solarium/Client/RequestBuilder/MoreLikeThis.php
View file @
22213ac7
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
* Copyright 2011 Bas de Nooijer.
* Copyright 2011 Gasol Wu. PIXNET Digital Media Corporation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
...
...
@@ -29,6 +31,7 @@
* policies, either expressed or implied, of the copyright holder.
*
* @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
* @copyright Copyright 2011 Gasol Wu <gasol.wu@gmail.com>
* @license http://github.com/basdenooijer/solarium/raw/master/COPYING
* @link http://www.solarium-project.org/
*
...
...
@@ -42,7 +45,8 @@
* @package Solarium
* @subpackage Client
*/
class
Solarium_Client_RequestBuilder_MoreLikeThis
extends
Solarium_Client_RequestBuilder
class
Solarium_Client_RequestBuilder_MoreLikeThis
extends
Solarium_Client_RequestBuilder
{
/**
...
...
library/Solarium/Client/ResponseParser/MoreLikeThis.php
View file @
22213ac7
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
* Copyright 2011 Gasol Wu. PIXNET Digital Media Corporation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
...
...
@@ -28,7 +29,7 @@
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holder.
*
* @copyright Copyright 2011
Bas de Nooijer <solarium@raspberry.nl
>
* @copyright Copyright 2011
Gasol Wu <gasol.wu@gmail.com
>
* @license http://github.com/basdenooijer/solarium/raw/master/COPYING
* @link http://www.solarium-project.org/
*
...
...
@@ -42,7 +43,8 @@
* @package Solarium
* @subpackage Client
*/
class
Solarium_Client_ResponseParser_MoreLikeThis
extends
Solarium_Client_ResponseParser_Select
class
Solarium_Client_ResponseParser_MoreLikeThis
extends
Solarium_Client_ResponseParser_Select
{
/**
...
...
@@ -57,7 +59,9 @@ class Solarium_Client_ResponseParser_MoreLikeThis extends Solarium_Client_Respon
$query
=
$result
->
getQuery
();
$postResult
=
parent
::
parse
(
$result
);
if
(
isset
(
$data
[
'interestingTerms'
])
and
'none'
!=
$query
->
getInterestingTerms
())
{
if
(
isset
(
$data
[
'interestingTerms'
])
and
'none'
!=
$query
->
getInterestingTerms
()
)
{
$terms
=
$data
[
'interestingTerms'
];
if
(
'details'
==
$query
->
getInterestingTerms
())
{
$tempTerms
=
array
();
...
...
library/Solarium/Query/MoreLikeThis.php
View file @
22213ac7
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
* Copyright 2011 Bas de Nooijer.
* Copyright 2011 Gasol Wu. PIXNET Digital Media Corporation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
...
...
@@ -29,6 +31,7 @@
* policies, either expressed or implied, of the copyright holder.
*
* @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
* @copyright Copyright 2011 Gasol Wu <gasol.wu@gmail.com>
* @license http://github.com/basdenooijer/solarium/raw/master/COPYING
* @link http://www.solarium-project.org/
*
...
...
@@ -53,7 +56,15 @@ class Solarium_Query_MoreLikeThis extends Solarium_Query
* Query components
*/
const
COMPONENT_DISMAX
=
'dismax'
;
/**
* Query component morelikethis
*/
const
COMPONENT_MORELIKETHIS
=
'morelikethis'
;
/**
* Query component highlighting
*/
const
COMPONENT_HIGHLIGHTING
=
'highlighting'
;
/**
...
...
library/Solarium/Result/MoreLikeThis.php
View file @
22213ac7
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
* Copyright 2011 Gasol Wu. PIXNET Digital Media Corporation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
...
...
@@ -28,7 +29,7 @@
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holder.
*
* @copyright Copyright 2011
Bas de Nooijer <solarium@raspberry.nl
>
* @copyright Copyright 2011
Gasol Wu <gasol.wu@gmail.com
>
* @license http://github.com/basdenooijer/solarium/raw/master/COPYING
* @link http://www.solarium-project.org/
*
...
...
@@ -39,7 +40,7 @@
/**
* MoreLikeThis query result
*
* This is the standard resulttype for a
select
query. Example usage:
* This is the standard resulttype for a
moreLikeThis
query. Example usage:
* <code>
* // total solr results
* $result->getNumFound();
...
...
@@ -58,6 +59,11 @@
*/
class
Solarium_Result_MoreLikeThis
extends
Solarium_Result_Select
{
/**
* interesting terms
*/
protected
$_interestingTerms
;
/**
* this will show what "interesting" terms are used for the MoreLikeThis
* query. These are the top tf/idf terms. NOTE: if you select 'details',
...
...
@@ -68,8 +74,6 @@ class Solarium_Result_MoreLikeThis extends Solarium_Result_Select
*
* @var array
*/
protected
$_interestingTerms
;
public
function
getInterestingTerms
()
{
$query
=
$this
->
getQuery
();
...
...
library/Solarium/Result/Select/MoreLikeThis.php
View file @
22213ac7
...
...
@@ -42,7 +42,8 @@
* @package Solarium
* @subpackage Result
*/
class
Solarium_Result_Select_MoreLikeThis
implements
IteratorAggregate
,
Countable
class
Solarium_Result_Select_MoreLikeThis
implements
IteratorAggregate
,
Countable
{
/**
...
...
library/Solarium/Result/Select/MoreLikeThis/Result.php
View file @
22213ac7
...
...
@@ -42,7 +42,8 @@
* @package Solarium
* @subpackage Result
*/
class
Solarium_Result_Select_MoreLikeThis_Result
implements
IteratorAggregate
,
Countable
class
Solarium_Result_Select_MoreLikeThis_Result
implements
IteratorAggregate
,
Countable
{
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment