Can Solr Index ASPX Files? - solr

When I try to index ASPX files using Solr, I keep getting an error. My ASPX file is very standard. Does anyone know if Solr just isn't able to index ASPX files? If I change the extension from ASPX to HTML, Solr can index the file just fine which I find very odd.
The command I use is (im a Windows user):
java -Dc=collection -Drecursive -Dfiletypes=aspx jar example/exampledocs/post.jar c:/folder
I get the errors:
SimplePostTool: WARNING: Solr returned an error #400 (Bad Request) for url: http://localhost:8983/solr/collection/update
SimplePostTool: WARNING: Response: <?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">400</int>
<int name="QTime">1</int>
</lst>
<lst name="error">
<lst name="metadata">
<str name="error-class">org.apache.solr.common.SolrException</str>
<str name="root-error-class">com.ctc.wstx.exc.WstxUnexpectedCharException</str>
</lst>
<str name="msg">Unexpected character '=' (code 61); expected a semi-colon after the reference for entity 'l'
at [row,col {unknown-source}]: [8,43]</str>
<int name="code">400</int>
</lst>
</response>
In the Solr log:
org.apache.solr.common.SolrException: Unexpected character '=' (code 61); expected a semi-colon after the reference for entity 'l'

Related

Winwdows solr post - Invalid UTF-8 middle byte 0xe3 (at char #10, byte #-1)

My code c2020 is running and available what I visit http://localhost:8983/solr/#/c2020/query.
Locally, when I try to run:
solr-7.7.2> java -jar -Dc=c2020 example\exampledocs\post.jar "C:\temp\path_to\a_doc.pdf"
I get:
SimplePostTool version 5.0.0
Posting files to [base] url http://localhost:8983/solr/c2020/update using content-type application/xml...
POSTing file A Half Century of Macro Momentum_vf.pdf to [base]
SimplePostTool: WARNING: Solr returned an error #400 (Bad Request) for url: http://localhost:8983/solr/c2020/update
SimplePostTool: WARNING: Response: <?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">400</int>
<int name="QTime">6</int>
</lst>
<lst name="error">
<lst name="metadata">
<str name="error-class">org.apache.solr.common.SolrException</str>
<str name="root-error-class">java.io.CharConversionException</str>
</lst>
<str name="msg">Invalid UTF-8 middle byte 0xe3 (at char #10, byte #-1)</str>
<int name="code">400</int>
</lst>
</response>
SimplePostTool: WARNING: IOException while reading response: java.io.IOException: Server returned HTTP response code: 400 for URL: http://localhost:8983/solr/c2020/update
1 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/c2020/update...
Time spent: 0:00:00.310
Now, if I run:
java -Durl=http://localhost:8983/solr/c2020/update/extract -jar example\exampledocs\post.jar "C:\temp\path_to\a_doc.pdf"
It works:
SimplePostTool version 5.0.0
Posting files to [base] url http://localhost:8983/solr/c2020/update/extract using content-type application/xml...
POSTing file a_doc.pdf to [base]
1 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/c2020/update/extract...
Time spent: 0:00:14.647
But it does not send all "fields" I want to see such as the file path or the file name.
I'd like to get the raw post doc to work if anyone could advise.

SolrCloud backup data not finding on my system path

When I ran the SolrCloud (6.3.0) Back API using this url backup url
It returns response status 0 i.e no error
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">213</int>
</lst>
<lst name="success">
<lst name="localhost:8983_solr">
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">43</int>
</lst>
</lst>
</lst>
</response>
But I didn't find any locations_back folder with backed up data on my system.
When I ran this curl from command line, it returns some numbers like 32058, 32059,32060 etc.
curl http://localhost:8983/solr/admin/collections?action=BACKUP&name=locations_back&collection=locations&location=/opt/solr/server/solr
[1] 32058
[2] 32059
[3] 32060
Where I tested with location param path location=/opt/solr/server/solr OR location =/
But It also didn't show any locations_back folder with backed up data on my system.
In order to troubleshoot this issue please check the following:
modify the backup folder from /opt/solr/server/solr to /tmp/ That will help you understanding if it's a permission problem;
Is your collection really called locations (as one of your params is collection=locations)? Change it as necessary
Check the Solr server logs in order to see what's the error;
Is SSH enabled or are you hitting a firewall?
Are your Solr nodes healthy?
Are you calling that url through a browser or programmatically?

org.apache.solr.search.SyntaxError: on SOLR Multi-select Facet Query

I am trying to debug an issue that I am having with the following query:
q=(Cartridge)&fq={!tag=Deals_EN_ss}Deals_EN_ss:"Clearance%20Items"%20OR%20{!tag=Deals_EN_ss}Deals_EN_ss:"On%20Promotion"&defType=edismax&facet=true&facet.field={!ex=Deals_EN_ss}Deals_EN_ss&facet.field={!key=Brand_EN_ss}Brand_EN_ss&facet.field={!key=Rating_EN_ss}Rating_EN_ss&facet.field={!key=CA_Default_Price_EN_p}CA_Default_Price_EN_p
Here, I am trying to perform a multi-select facet query, filtering on the Deals_EN_ss facet. When I run this query against my SOLR server. I get the following response back:
<response>
<lst name="responseHeader">
<int name="status">400</int>
<int name="QTime">3</int>
<lst name="params">
<str name="facet">true</str>
<str name="q">(Cartridge)</str>
<arr name="facet.field">
<str>{!ex=Deals_EN_ss}Deals_EN_ss</str>
<str>{!key=Brand_EN_ss}Brand_EN_ss</str>
<str>{!key=Rating_EN_ss}Rating_EN_ss</str>
<str>{!key=CA_Default_Price_EN_p}CA_Default_Price_EN_p</str>
</arr>
<str name="wt">xml</str>
<arr name="fq">
<str>
{!tag=Deals_EN_ss}Deals_EN_ss:"Clearance Items" OR {!tag=Deals_EN_ss}Deals_EN_ss:"On Promotion"
</str>
</arr>
<str name="defType">edismax</str>
</lst>
</lst>
<lst name="error">
<str name="msg">
org.apache.solr.search.SyntaxError: Cannot parse 'Deals_EN_ss:"On': Lexical error at line 1, column 16. Encountered: <EOF> after : "\"On"
</str>
<int name="code">400</int>
</lst>
</response>
I am not sure what I am missing here. Can anyone please help me look into the query syntax?
Tags and excludes are specified as local params {!...}, which can only occure once at the start of each parameter.
See https://wiki.apache.org/solr/LocalParams
Your first fq parameter contains a second illegal local param.
Try to remove the second occurance of {!tag=Deals_EN_ss}.
Your query should look like this then:
q=(Cartridge)&fq={!tag=Deals_EN_ss}Deals_EN_ss:"Clearance%20Items"%20OR%20Deals_EN_ss:"On%20Promotion"&defType=edismax&facet=true&facet.field={!ex=Deals_EN_ss}Deals_EN_ss&facet.field={!key=Brand_EN_ss}Brand_EN_ss&facet.field={!key=Rating_EN_ss}Rating_EN_ss&facet.field={!key=CA_Default_Price_EN_p}CA_Default_Price_EN_p

Not able to get results in Solr

I do a full-import and I get the following response for the below command
http://localhost:8983/solr/karan/dataimport?command=full-import&commit=true&clean=false
But when I run the following snippet
public class SolrJSearcher {
public static void main(String[] args) throws SolrServerException, IOException {
SolrClient solr = new HttpSolrClient("http://localhost:8983/solr/karan");
SolrQuery query = new SolrQuery();
query.set("q", "karan");
QueryResponse response = solr.query(query);
SolrDocumentList results = response.getResults();
for (int i = 0; i < results.size(); ++i) {
System.out.println(results.get(i));
}
}
}
I get no results even though two rows are there.If I change the q to : I get two results without the name karan.Can you please clarify what is going wrong in this If I try in the sample project techproducts with the same changes I get the results as expected.
Solrconfig.xml
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler>
data-config.xml
<dataConfig>
<dataSource type="JdbcDataSource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/greed"
user="root"
password="kalkoti"/>
<document>
<entity name="id"
query="select id,name from testing">
</entity>
</document>
</dataConfig>
I have created the collection karan using
solr create -c karan
Response from full-import
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">12</int>
</lst>
<lst name="initArgs">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</lst>
<str name="command">full-import</str>
<str name="status">idle</str>
<str name="importResponse"/>
<lst name="statusMessages">
<str name="Total Requests made to DataSource">1</str>
<str name="Total Rows Fetched">2</str>
<str name="Total Documents Processed">2</str>
<str name="Total Documents Skipped">0</str>
<str name="Full Dump Started">2015-07-06 13:55:26</str>
<str name="">
Indexing completed. Added/Updated: 2 documents. Deleted 0 documents.
</str>
<str name="Committed">2015-07-06 13:55:26</str>
<str name="Time taken">0:0:0.431</str>
</lst>
</response>
You aren't specifying what fields should be written to in your data-config.xml file. See https://cwiki.apache.org/confluence/display/solr/Uploading+Structured+Data+Store+Data+with+the+Data+Import+Handler
You haven't given us your full schema.xml or solrconfig.xml files, so it is hard to tell you exactly what to do, but Solr uses the select request handler as default, which uses the text field as the default search field. Meaning you will need to map whatever database column contains the term karan to the text field.

About Suggester component

I am a newbie in solr. Recently I have installed solr 3.4 for my undergrad thesis purpose. I have tried to configure suggester component by the reference of http://solr.pl/en/2010/11/15/solr-and-autocomplete-part-2/
it did not give me the actual result after following all instruction and code.
after query http://localhost:8983/solr/suggest?q=har I got
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">32</int>
</lst>
<lst name="spellcheck">
<lst name="suggestions"/>
</lst>
</response>
Where the actual one was
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">0</int>
</lst>
<lst name="spellcheck">
<lst name="suggestions">
<lst name="dys">
<int name="numFound">4</int>
<int name="startOffset">0</int>
<int name="endOffset">3</int>
<arr name="suggestion">
<str>hard drive</str>
<str>hard drive samsung</str>
<str>hard drive seagate</str>
<str>hard drive toshiba</str>
</arr>
</lst>
</lst>
</lst>
</response>
I am assuming that I am not getting the suggestion .
I dont know whether am I wrong or not . It will be very helpful for me if someone clear my confusion and how could I approach further if I am wrong.
Did you build the dictionary? And does the name_autocomplete field actually hold the example data?

Resources