I'm working on an asp.net project and I'm having some issues with changing the Examine Indexer.
I used to have a StandardAnalyzer as an indexer but now I need to use an ArabicAnalyzer as an indexer.
When testing it separately all I done was changing:
<add name="EntityIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
supportUnpublished="false"
supportProtected="false"
interval="10"
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>
With:
<add name="EntityIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
supportUnpublished="false"
supportProtected="false"
interval="10"
analyzer="Lucene.Net.Analysis.AR, Lucene.Net"/>
And it worked properly.
When tried to do the same on my existing project I got the following exception in an YSOD page.
Line 31:
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Value cannot be null.
I didn't find a solution for this.
Do you have any ideas how to solve this?
Update:
<Examine>
<ExamineIndexProviders>
<providers>
<add name="InternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
supportUnpublished="false"
supportProtected="true"
analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>
<add name="InternalMemberIndexer" type="UmbracoExamine.UmbracoMemberIndexer, UmbracoExamine"
supportUnpublished="true"
supportProtected="true"
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>
<add name="EntityIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
supportUnpublished="false"
supportProtected="false"
interval="10"
analyzer="Lucene.Net.Analysis.AR, Lucene.Net"/>
</providers>
</ExamineIndexProviders>
<ExamineSearchProviders defaultProvider="ExternalSearcher">
<providers>
<add name="InternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>
<add name="ExternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" />
<add name="InternalMemberSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
analyzer="Lucene.Net.Analysis.AR, Lucene.Net" enableLeadingWildcards="true"/>
<add name="EntitySearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
analyzer="Lucene.Net.Analysis.AR, Lucene.Net" enableLeadingWildcards="true"/>
</providers>
</ExamineSearchProviders>
</Examine>
If it fails on an existing project, you may need to delete the existing index and then restart the application.
The indexes are all stored at ~/app_data/Temp/ExamineIndexes/, so you could just delete the specific index folder from within this folder and restart the application. This should prompt Umbraco to start re-indexing the content.
Also, you should also set the ExamineSearchProvider too, not just the ExamineIndexProvider. This is in the same config file. This ensures that the same Analyzer type is used to search the results as is to index them.
Edit
Looking at the configuration, you are missing an Analyzer="" on the ExternalSearcher
Further edit
The value Lucene.Net.Analysis.AR isn't a valid analyzer value it is just the namespace of an analyzer. I didn't check as I assumed you had, but the value should, in both instances be:
analyzer="Lucene.Net.Analysis.AR.ArabicAnalyzer, Lucene.Net"
See here: http://lucenenet.apache.org/docs/3.0.3/d2/d94/class_lucene_1_1_net_1_1_analysis_1_1_a_r_1_1_arabic_analyzer.html
I figured it out, What I should've done is changing:
<add name="EntityIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
supportUnpublished="false"
supportProtected="false"
interval="10"
analyzer="Lucene.Net.Analysis.AR, Lucene.Net"/>
with:
<add name="EntityIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
supportUnpublished="false"
supportProtected="false"
interval="10"
analyzer="Lucene.Net.Analysis.AR.ArabicAnalyzer, Lucene.Net.Contrib.Analyzers"/>
And changing the SearchProvider as well.
Related
How can i add entities/parameters into my asp.net mvc application. I want to allow cors to send ajax-requests into a database via asp.net webservice. Does anyone have experience fixing this?
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Headers" value="accept, content-type" />
<add name="Access-Control-Allow-Origin" value="http://localhost/QvAJAXZfc/opendoc.htm?document=test.qvw&lang=en-US&host=QVS%40servb"/>
<add name="Access-Control-Allow-Methods" value="POST, GET, OPTIONS" />
</customHeaders>
It shows me an error underlining the lang and the host section of the value, where i want to access.
Warm regards
Make sure that you are adding them in correct section. Change the whole url to just localhost and it will work
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Headers" value="accept, content-type" />
<add name="Access-Control-Allow-Origin" value="http://localhost"/>
<add name="Access-Control-Allow-Methods" value="POST, GET, OPTIONS" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
Got the following problem:
I've created simple mvc 5 project with individual user accounts authentication.
Everything works i can add users,roles,everything is stored in the database - all seems to be fine. Now i want to change authetication to organisational:
<system.webServer>
<modules>
<add name="WSFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
<add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
</modules>
</system.webServer>
<system.identityModel>
<identityConfiguration>
<audienceUris>
<add value="myUrl" />
</audienceUris>
<securityTokenHandlers>
<remove type="System.IdentityModel.Tokens.SamlSecurityTokenHandler, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add type="System.IdentityModel.Tokens.SamlSecurityTokenHandler, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<samlSecurityTokenRequirement>
<nameClaimType value="myClaim"/>
</samlSecurityTokenRequirement>
</add>
</securityTokenHandlers>
<certificateValidation certificateValidationMode="None" />
<issuerNameRegistry type="System.IdentityModel.Tokens.ValidatingIssuerNameRegistry, System.IdentityModel.Tokens.ValidatingIssuerNameRegistry">
<authority name="mySts">
<keys>
<add thumbprint="myThumb" />
</keys>
<validIssuers>
<add name="mySts" />
</validIssuers>
</authority>
</issuerNameRegistry>
</identityConfiguration>
</system.identityModel>
<system.identityModel.services>
<federationConfiguration>
<cookieHandler requireSsl="true" />
<wsFederation passiveRedirectEnabled="true" issuer="mySTs" realm="myUrl" requireHttps="true" />
</federationConfiguration>
</system.identityModel.services>
It works - i can authenticate,but when i want to add new user (based on User.Identity.Name to my existing database:
UserManager.CreateAsync(user);
I get weird error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.)
although i didn't change anything in connection,dbcontext and so on.
What could be a reason of such behavior?
Something seems to be missed in your web.config file. Try to add connectionStrings to your web.config by editing the code below according to your database and connection properties:
web.config:
<configuration>
<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(localdb)\v11.0;
Initial Catalog=aspnet-YourDatabaseName; Integrated Security=SSPI; AttachDBFilename=|DataDirectory|\aspnet-YourDatabaseName.mdf" />
I'm experiencing a problem when using Sitecore MVC 3 rendering with GZip content compression.
I followed the blog post of John West, how to enable MVC in Sitecore.
Until now it works perfectly, the pages are rendered. But if I run the page on IIS and enable content compression (gzip), the page doesn't load. I get a "Content Encoding Error" in Firefox. Other browser display various error messages.
Has somebody experienced similar issues? Do you have any idea what the problem may be? Where should I start checking? I have to use compression on the pages.
We are using Sitecore 6, Update 5: "Sitecore 6.6.0 rev. 130404"
Could this be a Sitecore bug?
EDIT 1: I am also running ASP.NET WebForms on the Sitecore instance and it works fine also with gzip compression.
EDIT 2: I have 'dynamicCompressionBeforeCache' enabled. My web.config related to gzip config:
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true" dynamicCompressionBeforeCache="true" />
Sitecore confirmed that they can reproduce the issue. When setting dynamicCompressionBeforeCache="true", the encoding does not work correctly for some reason.
One solution is to remove this setting. After applying dynamicCompressionBeforeCache="false" it works fine.
You should probably enable gzip in your web.config
<system.webServer>
<httpCompression directory="%SystemDrive%\inetpub\
temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
<dynamicTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>
</system.webServer>
There are a few more tricks here
Setting the gzip compression in asp.net
I am facing a problem while trying to use GZip .
I have used the below entries in my config files i.e., applicationHost.config and web.config
<httpCompression>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" dynamicCompressionLevel="4" />
</httpCompression>
<urlCompression doDynamicCompression="true" doStaticCompression="true"/>
I have my application being deployed on IIS 7.5.
I have seen these suggestions over the net and I happen to hear that I would not need an exclusive stream code to be written. An entry to config file would suffice.
But still I get an error when my WCF service returns me a collection object with records over 1000. The object is a serializable object.
Please help me in this issue
I have the following section added to my web.config:
<system.webServer>
<caching>
<profiles>
<add extension=".html" policy="CacheUntilChange" kernelCachePolicy="DontCache" location="Client" />
<add extension=".htm" policy="CacheUntilChange" kernelCachePolicy="DontCache" location="Client" />
<add extension=".gif" policy="CacheUntilChange" kernelCachePolicy="DontCache" location="Client" />
<add extension=".js" policy="CacheUntilChange" kernelCachePolicy="DontCache" location="Client" />
<add extension=".css" policy="CacheUntilChange" kernelCachePolicy="DontCache" location="Client" />
<add extension=".jpg" policy="CacheUntilChange" kernelCachePolicy="DontCache" location="Client" />
</profiles>
</caching>
</system.webServer>
which was taken directly from here
but I am getting an error in my web.config, saying:
Unrecognized configuration section system.web/caching/profiles
also, I see this in visual studio:
The element caching has invalid child element 'profiles', List of possible expected: cache, outputcache, outputcacheSettings, sqlCacheDependency'
did something about this configuration change as I see alot of examples on the web with this exact configuration?
In your screenshot you have the caching under <system.web> and not <system.webServer> and since profiles is not a valid element under <caching> for <system.web> you will get that error.
What you show in code example is under <system.webServer>, what you show in your screenshot is under <system.web>, it needs to be under webServer for it to get the profiles option, under system.web like you had it offers all those options that the error you received was talking about, behaves differently depending on where you call it from