Comments (3)
The Solr server will take anything that my _documentToXmlFragment method
encodes with htmlspecialchars
and return it to its original state. What is probably happening is that your
source content has HTML entities in
it before it even gets to my conversion, but you want to be able to search on
the character the entities
represent. For that, you should normalize your source content before giving it
to Solr (or perhaps there is a
filter that can do this for you on the Solr side?) - a possible method would be
to use html_entity_decode
http://us3.php.net/manual/en/function.html-entity-decode.php on any fields you
suspect to have pre-
existing entities. I however can't do this in the client because it would be a
transform on the data that
someone else may not want (there may actually be someone out there that would
want to be able to search on
the full token "©" or similar.
On my Solr 1.4 instance, I was able to verify that I could find a document
indexed with a field "text" with value
"& < >" by the searches "text:&", "text:<", and "text:>" - just as it seems you
want to do. Those characters in
the document's field would have been converted to entities and then decoded by
Solr when indexed. For
reference, the text field had the following type definition in my schema.xml:
<!-- Less flexible matching, but less false matches. Probably not ideal for product names,
but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
<fieldType name="textTight" class="solr.TextField" positionIncrementGap="100" >
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
</fieldType>
So, if what I've explained represents and understanding of your issue, I think
your problem is best solved by
either normalizing your source content to not contain HTML entities before you
pass it to Solr or by using an
appropriate field type filter defined within your schema.xml on the Solr server.
Original comment by [email protected]
on 10 Dec 2009 at 4:53
from solr-php-client.
Taking a look at our code - thanks for the pointers
Original comment by [email protected]
on 10 Dec 2009 at 1:42
from solr-php-client.
Original comment by [email protected]
on 8 Feb 2010 at 6:26
- Changed state: Done
from solr-php-client.
Related Issues (20)
- How to enable wildcard HOT 1
- Cannot use root-level URL Solr servers HOT 2
- Basic Auth HOT 5
- Added feature. Get Solr system information HOT 1
- SOLR - 1 writer server 1 search server work on realtime HOT 4
- Basic Auth r64 Does Not Support Distributed Searches HOT 2
- keep alive connection HOT 1
- Support for proxy
- Composer support HOT 1
- Update copyrights to reflect PTC ownership HOT 1
- incorrect implementation of "ping" HOT 10
- Facet Query problem HOT 1
- Patch for /branches/response_parsing/Apache/Solr/Service.php HOT 2
- Search handler resolution HOT 1
- getting problem in configuring the solr-php-cline HOT 1
- Solr 4.3.0 HOT 3
- Get Spell Check Suggestions in frontend.
- Solr Indexing errror:Fatal error: Uncaught exception 'Apache_Solr_HttpTransportException' with message ''400' Status: Bad Request' HOT 1
- Add support to set search servlet [other than "select"] HOT 1
- PERFORMANCE WARNING: Overlapping onDeckSearchers=2 &Error opening new searcher.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solr-php-client.